From 45b8895ac9ff400a53a1034081a2c480664f235e Mon Sep 17 00:00:00 2001 From: bushing Date: Sat, 2 May 2009 04:49:36 -0700 Subject: [PATCH] don't try to correct ECC on uninitialized pages --- nand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nand.c b/nand.c index c88002e..03129dc 100644 --- a/nand.c +++ b/nand.c @@ -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++;