[PATCH 4/4] MTD: drivers return max_bitflips, mtd returns -EUCLEAN
Shmulik Ladkani
shmulik.ladkani at gmail.com
Sat Mar 31 02:37:52 EDT 2012
Hi Mike,
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 [1].
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.
[1]
http://lists.infradead.org/pipermail/linux-mtd/2012-March/040371.html
http://lists.infradead.org/pipermail/linux-mtd/2012-March/040343.html
Regards,
Shmulik
More information about the linux-mtd
mailing list