[PATCH] mtd: use ecc_strength to determine whether to perform bitflip_threshold test

Artem Bityutskiy dedekind1 at gmail.com
Wed May 2 08:13:27 EDT 2012


On Tue, 2012-05-01 at 12:56 -0700, Mike Dunn wrote:
> This is a minor change to the recent EUCLEAN patch set that I think makes it
> more correct.  Currently, the test in mtd_read() that determines whether or not
> to return -EUCLEAN is skipped if bitflip_threshold == 0.  This logic was added
> (without much thought) to fix a bug in an earlier version of the patch set that
> would have caused devices lacking ecc to always return -EUCLEAN [1].
> 
> This patch replaces bitflip_threshold with ecc_strength as the value used to
> determine whether the device has ecc capability.  I think this is more correct
> because bitflip_threshold can be changed via sysfs.  Currently, if the user sets
> it to zero, -EUCLEAN is never returned.  This is also what happens if the user
> sets it to a value exceeding ecc_strength.  With this patch, if the user sets it
> to zero, -EUCLEAN will always be returned (provided ecc_strength > 0), which
> makes more sense, and may even be useful occasionally.
> 
> [1] http://lists.infradead.org/pipermail/linux-mtd/2012-March/040468.html
> 
> Signed-off-by: Mike Dunn <mikedunn at newsguy.com>


Folded this patch into:

mtd: driver _read() returns max_bitflips; mtd_read() returns -EUCLEAN

and pushed to l2-mtd.git, thanks!

-- 
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20120502/a9a3fc2a/attachment-0001.sig>


More information about the linux-mtd mailing list