summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2015-01-07 18:39:57 +0100
committerStefan Agner <stefan.agner@toradex.com>2015-01-07 18:39:57 +0100
commit90f60ffa754e468c4862d24cccde4bfc6da8e791 (patch)
tree0cbf72f0e26640b35824ba0d2fc88fd90b483e25
parentf7e57f71da1eecbf1ac28339868d15492c929925 (diff)
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). Some flash show bit flips in empty pages which are larger then the corrected bit count according to the ECC controller. It is not yet clear how to solve this correctly, discussion is ongoing: http://thread.gmane.org/gmane.linux.ports.arm.kernel/295424 Since we habe a 24-bit correction, this allows up to 12 bit flips on a empty page before reporting it as page with ECC errors.
-rw-r--r--drivers/mtd/nand/vf610_nfc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c
index 1af314f87dc..baf9084f1e2 100644
--- a/drivers/mtd/nand/vf610_nfc.c
+++ b/drivers/mtd/nand/vf610_nfc.c
@@ -521,7 +521,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)) {
nfc->page = -1;
return -1;
}