[U-Boot] [PATCH v3 3/8] mtd: vf610_nfc: allow bitflips in an empty page

Stefan Agner stefan at agner.ch
Fri May 8 19:07:08 CEST 2015


Allow bit flips in a empty page up to half of the recoverable
bits (strength / 2).

Signed-off-by: Stefan Agner <stefan at agner.ch>
---
 drivers/mtd/nand/vf610_nfc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c
index 66b335d..16485f5 100644
--- a/drivers/mtd/nand/vf610_nfc.c
+++ b/drivers/mtd/nand/vf610_nfc.c
@@ -527,7 +527,7 @@ static inline int vf610_nfc_correct_data(struct mtd_info *mtd, u_char *dat)
 	flip = count_written_bits(dat, nfc->chip.ecc.size, ecc_count);
 
 	/* ECC failed. */
-	if (flip > ecc_count)
+	if (flip > ecc_count && flip > (nfc->chip.ecc.strength / 2))
 		return -1;
 
 	/* Erased page. */
-- 
2.3.7



More information about the U-Boot mailing list