[PATCH v2] MTD: modify mtd api to return bitflip info on read operations

Mike Dunn mikedunn at newsguy.com
Wed Dec 7 13:32:34 EST 2011


Hi Ricard, thanks for chiming in.

On 12/07/2011 12:01 AM, Ricard Wanderlof wrote:
>
>
> So, something like this:
> - The driver reports number of bit flips and current ECC strength etc to
>   the mtd layer.
> - Based on some userspace knob, the mtd framework reports -EUCLEAN if
>   scrubbing is needed.
> - Upper layers perform scrubbing if they want to (i.e. UBI) or not (i.e.
>   JFFS2).


Sounds like a nice compromise between user configurability and keeping the
decision in the mtd layer.  The problem is that the read method currently goes
directly to the driver, so all drivers would have to be patched.  The last patch
I submitted was rejected as being too large.  And it can't be broken into
smaller patches because they are interdependent and not bisectable. 
Implementing this scheme would be an even larger patch, and the changes made to
every driver would bear scrutiny.


>
> I don't really see this as lying, more of a redefinition of what -EUCLEAN
> really means. The current behavior was invented when single-bit errors could
> be correct and nothing else, 


That is clear.  In mtdconcat.c, ecc_stats.corrected is incremented by one when
mtd->read() returns -EUCLEAN.


> and furthermore such bitflips were rare; now that multiple-bit errors are
> commonplace it's time to put more detail into what -EUCLEAN implies.  It's not
> really breaking anything old either, if sane defaults are used.
>


I'm willing to implement whatever consensus emerges, but I need buy-in from the
maintainers before I spend more time on it.

Thanks,
Mike




More information about the linux-mtd mailing list