]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mtd: nand: handle ECC errors in OOB
authorBrian Norris <computersforpeace@gmail.com>
Thu, 23 Jun 2011 23:45:24 +0000 (16:45 -0700)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Tue, 16 Aug 2011 13:45:40 +0000 (16:45 +0300)
commitbc044709bb0a6abaa65197359f8f98ee921e90a2
treec601be5144035e35e48c9673888dd5c9fb521735
parent8b3dc4980a5424d9dd4a08a43a6e89635a9254e2
mtd: nand: handle ECC errors in OOB

While the standard NAND OOB functions do not do ECC on the spare area,
it is possible for a driver to supply its own OOB ECC functions (e.g., HW
ECC). nand_do_read_oob should act like nand_do_read_ops in checking the
ECC stats and returning -EBADMSG or -EUCLEAN on uncorrectable errors or
correctable bitflips, respectively. These error codes could be used in
flash-based BBT code or in YAFFS, for example.

Doing this, however, messes with the behavior of mtd_do_readoob. Now,
mtd_do_readoob should check whether we had -EUCLEAN or -EBADMSG errors
and discard those as "non-fatal" so that the ioctls can still succeed
with (possibly uncorrected) data.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
drivers/mtd/mtdchar.c
drivers/mtd/nand/nand_base.c