[PATCH] MTD: mtdconcat NAND/Sibley support

Nicolas Pitre nico at cam.org
Wed Apr 26 12:26:36 EDT 2006


On Wed, 26 Apr 2006, Jörn Engel wrote:

> On Wed, 26 April 2006 12:04:51 -0400, Nicolas Pitre wrote:
> > On Wed, 26 Apr 2006, Belyakov, Alexander wrote:
> > 
> > > JFFS2 (and not only JFFS2) does not work on top of concatenated MTD
> > > device in case of NAND and Sibley chips due to missing
> > > concat_block_isbad(), concat_block_markbad(), concat_writev() and
> > > concat_writev_ecc() functions. If anyone cares - the patch below fixes
> > > that issue.
> > 
> > That won't work with Sibley.  You must call the underlying devices with 
> > writev() as well, using the appropriate vector for each device, and only 
> > once per subdevice.  Sibley flash must write everything all at once with 
> > a single writev call.
> 
> Everything?  Not just in chunks of 1KiB?

Well you can do more, obviously, and you can do less too.  But if you 
write less then it's still the whole 1KB that is gone.

The point is why is the patch so complex?

Something like:

	for (each subdevice) {
		determine_number_of_vector_entries_for_this_subdevice;
		limit_that_last_vector_entry_length_if_needed;
		writev(subdevice, vector, number_of_entries);
		update_vector_ptr_to_last_entry_above;
		readjust_offset_and_length_for_that_vector_entry;
		if (no_more_to_write)
			break;
	}

It seems to me that this should take four times less code than the 
proposed patch, and won't have any memory allocation nor copying 
required.


Nicolas


More information about the linux-mtd mailing list