don't try to correct ECC on uninitialized pages

This commit is contained in:
bushing 2009-05-02 04:49:36 -07:00
parent 5811742c07
commit 45b8895ac9

3
nand.c
View File

@ -263,7 +263,8 @@ int nand_correct(u32 pageno, void *data, void *ecc)
for(i=0;i<4;i++) {
u32 syndrome = *ecc_read ^ *ecc_calc; //calculate ECC syncrome
if(syndrome) {
// don't try to correct unformatted pages (all FF)
if ((*ecc_read != 0xFFFFFFFF) && syndrome) {
if(!((syndrome-1)&syndrome)) {
// single-bit error in ECC
corrected++;