Skip to contentSkip to conversation

onenand_wait and onenane_read

DISCUSSION Kyungmin Park 1 participant 1 message Jan 5, 2007 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi,

Quoted 3 lines

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