]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: rawnand: fix return value check for bad block status
authorAbhishek Sahu <absahu@codeaurora.org>
Wed, 13 Jun 2018 09:02:36 +0000 (14:32 +0530)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Thu, 21 Jun 2018 22:15:45 +0000 (00:15 +0200)
commit83c7938d904d98387b21470ff7538f209440573a
tree73ad7d8d31b23a5f71ebb04e641f25bc086dd30e
parentc4bf0884106c28a70403186f220df00f248e2e73
mtd: rawnand: fix return value check for bad block status

Positive return value from read_oob() is making false BAD
blocks. For some of the NAND controllers, OOB bytes will be
protected with ECC and read_oob() will return number of bitflips.
If there is any bitflip in ECC protected OOB bytes for BAD block
status page, then that block is getting treated as BAD.

Fixes: b9f74d134d94 ("mtd: nand: use read_oob() instead of cmdfunc() for bad block check")
Cc: <stable@vger.kernel.org>
Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
drivers/mtd/nand/raw/nand_base.c