[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180706054714.024064715@linuxfoundation.org>
Date: Fri, 6 Jul 2018 07:47:08 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Abhishek Sahu <absahu@...eaurora.org>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Boris Brezillon <boris.brezillon@...tlin.com>
Subject: [PATCH 4.14 44/61] mtd: rawnand: fix return value check for bad block status
4.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abhishek Sahu <absahu@...eaurora.org>
commit e9893e6fa932f42c90c4ac5849fa9aa0f0f00a34 upstream.
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: c120e75e0e7d ("mtd: nand: use read_oob() instead of cmdfunc() for bad block check")
Cc: <stable@...r.kernel.org>
Signed-off-by: Abhishek Sahu <absahu@...eaurora.org>
Reviewed-by: Miquel Raynal <miquel.raynal@...tlin.com>
Signed-off-by: Boris Brezillon <boris.brezillon@...tlin.com>
[backported to 4.14.y]
Signed-off-by: Abhishek Sahu <absahu@...eaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/mtd/nand/nand_base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -440,7 +440,7 @@ static int nand_block_bad(struct mtd_inf
for (; page < page_end; page++) {
res = chip->ecc.read_oob(mtd, chip, page);
- if (res)
+ if (res < 0)
return res;
bad = chip->oob_poi[chip->badblockpos];
Powered by blists - more mailing lists