Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 146b503e authored by Boris Brezillon's avatar Boris Brezillon Committed by Brian Norris
Browse files

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: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent 23151fd6
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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.