]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: nand_base: do not cache pages with uncorrectable ECC errors
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 3 Sep 2010 19:01:16 +0000 (22:01 +0300)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Sun, 24 Oct 2010 23:13:34 +0000 (00:13 +0100)
commitadabda199720f56a72918b1eaf062079d86a1b5f
tree73cdbcc7dc7decf45b4903ade3235bb18248b4c2
parentf413cbdb52a8149ddf0db9389e53f9ac4d408e82
mtd: nand_base: do not cache pages with uncorrectable ECC errors

Currently MTD caches the last read NAND page, even if there was an uncorrectable ECC
error. This patch prevents caching in case of uncorrectable ECC errors. The reason
is that we want to allow the user to re-read the NAND page several times. In case of
unstable bits re-trying may help.

Moreover, current behavior is wrong because the first read returns -EBADMSG (correctly)
but the second read succeeds and incorrectly returns 0 (because we read from the cache).

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/nand_base.c