onenand_wait and onenane_read

Kyungmin Park kyungmin.park at samsung.com
Fri Jan 5 02:18:46 EST 2007


Hi,

> Note that after the patch, onenane_wait seems to return non-zero even
> when the error is corrected by ecc.  Shouldn't it return zero in that
> case?

After ecc patch, I think is it really need to return error code when 1 bit ecc.
Even though there's 1-bit ecc the bufferram has valid data. since ecc logic already corrects it.

I think we don't need to return ecc error when 1-bit ecc. We only return error code when 2-bit ecc error

@@ -327,12 +327,12 @@ static int onenand_wait(struct mtd_info *mtd, int state)
                int ecc = this->read_word(this->base + ONENAND_REG_ECC_STATUS);
                if (ecc) {
                        DEBUG(MTD_DEBUG_LEVEL0, "onenand_wait: ECC error = 0x%04x\n", ecc);
-                       if (ecc & ONENAND_ECC_2BIT_ALL)
+                       if (ecc & ONENAND_ECC_2BIT_ALL) {
                                mtd->ecc_stats.failed++;
-                       else if (ecc & ONENAND_ECC_1BIT_ALL)
+                               return ecc;
+                       } else if (ecc & ONENAND_ECC_1BIT_ALL)
                                mtd->ecc_stats.corrected++;
                }
-               return ecc;
        }

        return 0;

Thank you,
Kyungmin Park



More information about the linux-mtd mailing list