[PATCH] mtd: nand: ignore ecc errors during bbt reads
Mike Dunn
mikedunn at newsguy.com
Tue Jun 12 09:23:29 EDT 2012
On 06/10/2012 10:45 PM, Brian Norris wrote:
>
> On Sun, Jun 10, 2012 at 4:50 AM, Shmulik Ladkani
> <shmulik.ladkani at gmail.com> wrote:
>> On Thu, 7 Jun 2012 11:32:08 -0700 Mike Dunn <mikedunn at newsguy.com> wrote:
>>> Ignore ecc errors in the scan_read_raw_oob() function. Also removed code that
>>> is now redundant.
>>>
>>> Signed-off-by: Mike Dunn <mikedunn at newsguy.com>
>>> ---
>>> drivers/mtd/nand/nand_bbt.c | 6 +++---
>>> 1 files changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
>>> index 30d1319..585da44 100644
>>> --- a/drivers/mtd/nand/nand_bbt.c
>>> +++ b/drivers/mtd/nand/nand_bbt.c
>>> @@ -319,7 +319,8 @@ static int scan_read_raw_oob(struct mtd_info *mtd, uint8_t *buf, loff_t offs,
>>>
>>> res = mtd_read_oob(mtd, offs, &ops);
>>>
>>> - if (res)
>>> + /* Ignore ECC errors when checking for BBM */
>>> + if (res && !mtd_is_bitflip_or_eccerr(res))
>>> return res;
>>
>> IMO this is not necessary.
>> Note the 'ops.mode' is initialized to MTD_OPS_RAW; meaning, no ECC is
>> performed during read ('ecc.read_page_raw' will be invoked).
>> Thus, EUCLEAN/EBADMSG should not be reported.
>> Am I missing something here?
>
> Shmulik is correct. A check for bitflips on a MTD_OPS_RAW operation is
> unnecessary.
Yes, I missed the ops mode raw. Obviously my analysis was wrong.
Good that nand_bbt is getting cleaned up some.
Thanks again Brian and Shmulik.
Mike
More information about the linux-mtd
mailing list