From: Stefan Agner Date: Fri, 8 May 2015 17:07:08 +0000 (+0200) Subject: mtd: vf610_nfc: allow bitflips in an empty page X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d111bf99a81feacd3876010984a28575964ff0dc;p=project%2Fbcm63xx%2Fu-boot.git mtd: vf610_nfc: allow bitflips in an empty page Allow bit flips in a empty page up to half of the recoverable bits (strength / 2). Signed-off-by: Stefan Agner --- diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c index 66b335d008..16485f5713 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. */