summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorBoris BREZILLON2015-09-30 23:45:29 +0200
committerBrian Norris2015-10-02 20:09:51 +0200
commit146b503e102778ee98d8ba59e9e178ab26a4af5b (patch)
tree2604caa01516051289c9260a654bb026d40aeaa8 /drivers/mtd/nand
parentmtd: nand: sunxi: replace the NFC_BUF_TO_USER_DATA() macro by an inline function (diff)
downloadkernel-qcow2-linux-146b503e102778ee98d8ba59e9e178ab26a4af5b.tar.gz
kernel-qcow2-linux-146b503e102778ee98d8ba59e9e178ab26a4af5b.tar.xz
kernel-qcow2-linux-146b503e102778ee98d8ba59e9e178ab26a4af5b.zip
mtd: nand: sunxi: fix bitflips in erased pages
Use the nand_check_erased_ecc_chunk() function to test if the ECC error was triggered by an erased page containing a few bitflips. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/sunxi_nand.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
index a76eb5173bb8..92245a312334 100644
--- a/drivers/mtd/nand/sunxi_nand.c
+++ b/drivers/mtd/nand/sunxi_nand.c
@@ -611,7 +611,9 @@ static int sunxi_nfc_hw_ecc_read_chunk(struct mtd_info *mtd,
sunxi_nfc_read_buf(mtd, oob, ecc->bytes + 4);
if (status & NFC_ECC_ERR(0)) {
- ret = -EIO;
+ ret = nand_check_erased_ecc_chunk(data, ecc->size,
+ oob, ecc->bytes + 4,
+ NULL, 0, ecc->strength);
} else {
/*
* The engine protects 4 bytes of OOB data per chunk.