[PATCH 1/3] mtd_debug: report ecc layout

Brian Norris computersforpeace at gmail.com
Wed Aug 10 13:07:53 EDT 2011


On Tue, Aug 9, 2011 at 1:57 PM, Ben Gardiner <bengardiner at nanometrics.ca> wrote:
> Add the ECC size and OOB available to that list. The other entries in the
> ecclayout struct are arrays and are not as meaningful as eccsize and oobavail.
> ---
> I noticed that the struct nand_ecclayout_user and its corresponding ioctl
> has been marked deprecated; however, since this is a 'debug' utility and at
> least one person found it useful I thought it would be a good idea to propose
> these changes anyways.

While I agree with your rationale for ignoring the deprecation (it's
OK for a debug utility), users of this feature should be warned that
struct nand_ecclayout_user will not report all information if there
are more ECC entries than "MTD_MAX_ECCPOS_ENTRIES" (i.e., 64). It will
simply truncate ECC at 64. This may be a problem for large page flash
with large ECC regions. It's a similar story for "oobavail" as well.

And before the question is asked, I'm not sure how to implement my
suggestion that "users of this feature should be warned". Perhaps just
a comment in the code?

Brian



More information about the linux-mtd mailing list