]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: nand/fsmc: Flip the bit only if the error index is < 4096
authorVipin Kumar <vipin.kumar@st.com>
Wed, 14 Mar 2012 06:17:11 +0000 (11:47 +0530)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 26 Mar 2012 23:58:43 +0000 (00:58 +0100)
commitbcf9c36790bdde2b3e6f7014bd995e9e9ac96dfd
tree16aeaba31da1e7a68e956f48e9b24b765f341a29
parentf247a104a28be3a32b74cfa694ec53ef86790fc9
mtd: nand/fsmc: Flip the bit only if the error index is < 4096

ECC can correct up to 8 bits in 512 bytes data + 13 bytes ecc. This means that
the algorithm can correct a max of 8 bits in 4200 bits ie the error indices can
be from 0 to 4199. Of these 0 to 4095 are for data and 4096 to 4199 for ecc.

The driver flips the bit only if the index is <= 4096. This is a bug since the
data bits are only from 0 to 4095.

This patch modifies the check as < 4096

Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/fsmc_nand.c