[PATCH 4/4] MTD: drivers return max_bitflips, mtd returns -EUCLEAN
shmulik.ladkani at gmail.com
Sat Mar 31 02:37:52 EDT 2012
On Fri, 30 Mar 2012 18:05:55 -0700 Mike Dunn <mikedunn at newsguy.com> wrote:
> > This seems wrong in the case that mtd->euclean_threshold == 0.
> > This could be the case for any of the following:
> > (1) NAND that uses ECC_NONE
> > (2) NAND drivers with HW_ECC that don't initialize chip->ecc.strength
> > (3) MTD without ECC (e.g., NOR)
> > (4) Other drivers that might have missed initializing mtd->ecc_strength
> > If I'm correct, (3) is quite significant, since non-ECC'd MTDs would
> > produce EUCLEAN statuses on every read.
> Yup. Again, oops!
Please re-consider having the 'euclean_threshold' comparison within the
NAND infrastructure (nand_base.c and clones), instead of within the
generic 'mtd_read()' wrapper, as discussed in .
This would inherently fix (3).
For code unification, we can have a small inlined function that does the
comparison, which may be used by nand_base.c and the clones.
More information about the linux-mtd