nand: nand_oobfree handling

chris chris at atmark-techno.com
Thu Jul 17 01:20:33 EDT 2008


Hi

It seems that while OOB layout structures (nand_ecclayout) are defined
to handle 8 (MTD_MAX_OOBFREE_ENTRIES) free areas, the current nand_base
code expects at least one area with a zero length.

http://lxr.linux.no/linux+v2.6.26/include/mtd/mtd-abi.h#L124
http://lxr.linux.no/linux+v2.6.26/drivers/mtd/nand/nand_base.c#L2552

This could cause problems for drivers that want to use all 8 free areas.

Also, it seems that flash_eraseall -j expects the first free area to be
big enough for the cleanmarker, which might not always be true.

I have attached a couple of patches that fix the problems I have
described above. They are taken against 2.6.24 and a non-current version
of mtd-utils... would you like me to prepare patches for the latest trees?

Cheers,

Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flash_eraseall.patch
Type: text/x-diff
Size: 3110 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-mtd/attachments/20080717/1bfa1cce/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nand-oobfree-loop-fix.patch
Type: text/x-diff
Size: 2924 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-mtd/attachments/20080717/1bfa1cce/attachment-0001.bin 


More information about the linux-mtd mailing list