mtd: nand: brcmnand: Zero bitflip is not an error
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Mon Dec 18 08:59:01 PST 2017
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=e44b9a9c135727f3410e029910275f40681dc8bc
Commit: e44b9a9c135727f3410e029910275f40681dc8bc
Parent: fdf2e821052958a114618a95ab18a300d0b080cb
Author: Albert Hsieh <wen.hsieh at broadcom.com>
AuthorDate: Mon Nov 20 11:26:26 2017 +0800
Committer: Richard Weinberger <richard at nod.at>
CommitDate: Fri Dec 15 22:26:48 2017 +0100
mtd: nand: brcmnand: Zero bitflip is not an error
A negative return value of brcmstb_nand_verify_erased_page() indicates a
real bitflip error of an erased page, and other return values (>= 0) show
the corrected bitflip number. Zero return value means no bitflip, but the
current driver code treats it as an error, and eventually leads to
falsely reported ECC error.
Fixes: 02b88eea9f9c ("mtd: brcmnand: Add check for erased page bitflip")
Signed-off-by: Albert Hsieh <wen.hsieh at broadcom.com>
Acked-by: Boris Brezillon <boris.brezillon at free-electrons.com>
Signed-off-by: Richard Weinberger <richard at nod.at>
---
drivers/mtd/nand/brcmnand/brcmnand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/brcmnand/brcmnand.c b/drivers/mtd/nand/brcmnand/brcmnand.c
index e0eb51d8c012..dd56a671ea42 100644
--- a/drivers/mtd/nand/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/brcmnand/brcmnand.c
@@ -1763,7 +1763,7 @@ try_dmaread:
err = brcmstb_nand_verify_erased_page(mtd, chip, buf,
addr);
/* erased page bitflips corrected */
- if (err > 0)
+ if (err >= 0)
return err;
}
More information about the linux-mtd-cvs
mailing list