]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mtd: driver _read() returns max_bitflips; mtd_read() returns -EUCLEAN
authorMike Dunn <mikedunn@newsguy.com>
Wed, 25 Apr 2012 19:06:11 +0000 (12:06 -0700)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Sun, 29 Apr 2012 19:22:29 +0000 (22:22 +0300)
commit5568eb3c3bb2816281b6a7c04db92434b72b1495
tree9b9cb3236aa5b54ff84c3dcd4aa287bc7aaa386c
parenteb6e1f866ddaaa1267c4a381af644a97b8444897
mtd: driver _read() returns max_bitflips; mtd_read() returns -EUCLEAN

The drivers _read() method, absent an error, return a non-negative integer
indicating the maximum number of bit errors that were corrected in any one
region comprising an ecc step.  MTD returns -EUCLEAN if this is >=
bitflip_threshold, 0 otherwise.  If bitflip_threshold is zero, the comparison is
not made since these devices lack ECC and always return zero in the non-error
case (thanks Brian) [1].  Note that this is a subtle change to the driver
interface.

This and the preceeding patches in this set were tested with ubi on top of the
nandsim and docg4 devices, running the ubi test io_basic from mtd-utils.

[1] http://lists.infradead.org/pipermail/linux-mtd/2012-March/040468.html

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
drivers/mtd/devices/docg3.c
drivers/mtd/mtdcore.c
drivers/mtd/mtdpart.c
drivers/mtd/nand/alauda.c
drivers/mtd/nand/nand_base.c
drivers/mtd/onenand/onenand_base.c
include/linux/mtd/nand.h