[PATCH 1/5] mtd: do not assume oobsize is power of 2

Artem Bityutskiy dedekind1 at gmail.com
Wed Aug 24 09:10:18 EDT 2011


On Tue, 2011-08-23 at 17:17 -0700, Brian Norris wrote:
> Previous generations of MTDs all used OOB sizes that were powers of 2,
> (e.g., 64, 128). However, newer generations of flash, especially NAND,
> use irregular OOB sizes that are not powers of 2 (e.g., 218, 224, 448).
> This means we cannot use masks like "mtd->oobsize - 1" to assume that we
> will get a proper bitmask for OOB operations.
> 
> These masks are really only intended to hide the "page" portion of the
> offset, leaving any OOB offset intact, so a masking with the writesize
> (which *is* always a power of 2) is valid and makes more sense.
> 
> This has been tested for read/write of NAND devices (nanddump/nandwrite)
> using nandsim and actual NAND flash.
> 
> Cc: stable at kernel.org [2.6.30+]
> Signed-off-by: Brian Norris <computersforpeace at gmail.com>

I removed -stable Cc, because this is not a bug-fix, and I feel this is
a bit risky for -stable. And pushed, thanks.

Pushed also all the other patches, and amended the MEMOOBSEL removal
patch.

-- 
Best Regards,
Artem Bityutskiy




More information about the linux-mtd mailing list