]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mtd: vf610_nfc: allow bitflips in an empty page
authorStefan Agner <stefan@agner.ch>
Fri, 8 May 2015 17:07:08 +0000 (19:07 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 20:43:28 +0000 (22:43 +0200)
Allow bit flips in a empty page up to half of the recoverable
bits (strength / 2).

Signed-off-by: Stefan Agner <stefan@agner.ch>
drivers/mtd/nand/vf610_nfc.c

index e3e132740a46451fe53dbf6dad130688b4a5fed2..fcc642ac2a783570a37ba6eebf670d76614a9572 100644 (file)
@@ -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. */