2011-06-03 13:09:24

by Daniel Mack

[permalink] [raw]
Subject: [PATCH] MTD: pxa3xx_nand: Fix blank page ECC mismatch

This bug was introduced in f8155a40 ("mtd: pxa3xx_nand: rework irq
logic") and causes the PXA3xx NAND controller fail to operate with NAND
flash that has empty pages. According to the comment in this block, the
hardware controller will report a double-bit error for empty pages,
which can and must be ignored.

This patch restores the original behaviour of the driver.

Signed-off-by: Daniel Mack <[email protected]>
Cc: Lei Wen <[email protected]>
Cc: Haojian Zhuang <[email protected]>
Cc: David Woodhouse <[email protected]>
Cc: [email protected]
---
drivers/mtd/nand/pxa3xx_nand.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 0c6ed72..60167d1 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -687,6 +687,8 @@ static int pxa3xx_nand_read_page_hwecc(struct mtd_info *mtd,
* OOB, ignore such double bit errors
*/
if (is_buf_blank(buf, mtd->writesize))
+ info->retcode = ERR_NONE;
+ else
mtd->ecc_stats.failed++;
}

--
1.7.5.1


2011-06-03 15:04:42

by Lei Wen

[permalink] [raw]
Subject: Re: [PATCH] MTD: pxa3xx_nand: Fix blank page ECC mismatch

On Fri, Jun 3, 2011 at 9:03 PM, Daniel Mack <[email protected]> wrote:
> This bug was introduced in f8155a40 ("mtd: pxa3xx_nand: rework irq
> logic") and causes the PXA3xx NAND controller fail to operate with NAND
> flash that has empty pages. According to the comment in this block, the
> hardware controller will report a double-bit error for empty pages,
> which can and must be ignored.
>
> This patch restores the original behaviour of the driver.
>
> Signed-off-by: Daniel Mack <[email protected]>
> Cc: Lei Wen <[email protected]>
> Cc: Haojian Zhuang <[email protected]>
> Cc: David Woodhouse <[email protected]>
> Cc: [email protected]
> ---
> ?drivers/mtd/nand/pxa3xx_nand.c | ? ?2 ++
> ?1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
> index 0c6ed72..60167d1 100644
> --- a/drivers/mtd/nand/pxa3xx_nand.c
> +++ b/drivers/mtd/nand/pxa3xx_nand.c
> @@ -687,6 +687,8 @@ static int pxa3xx_nand_read_page_hwecc(struct mtd_info *mtd,
> ? ? ? ? ? ? ? ? * OOB, ignore such double bit errors
> ? ? ? ? ? ? ? ? */
> ? ? ? ? ? ? ? ?if (is_buf_blank(buf, mtd->writesize))
> + ? ? ? ? ? ? ? ? ? ? ? info->retcode = ERR_NONE;
> + ? ? ? ? ? ? ? else
> ? ? ? ? ? ? ? ? ? ? ? ?mtd->ecc_stats.failed++;
> ? ? ? ?}
>
> --
> 1.7.5.1
>

Acked-by: Lei Wen <[email protected]>

2011-06-03 15:31:10

by Lei Wen

[permalink] [raw]
Subject: Re: [PATCH] MTD: pxa3xx_nand: Fix blank page ECC mismatch

Also cc to MTD mailist
Cc: [email protected]

On Fri, Jun 3, 2011 at 11:04 PM, Lei Wen <[email protected]> wrote:
> On Fri, Jun 3, 2011 at 9:03 PM, Daniel Mack <[email protected]> wrote:
>> This bug was introduced in f8155a40 ("mtd: pxa3xx_nand: rework irq
>> logic") and causes the PXA3xx NAND controller fail to operate with NAND
>> flash that has empty pages. According to the comment in this block, the
>> hardware controller will report a double-bit error for empty pages,
>> which can and must be ignored.
>>
>> This patch restores the original behaviour of the driver.
>>
>> Signed-off-by: Daniel Mack <[email protected]>
>> Cc: Lei Wen <[email protected]>
>> Cc: Haojian Zhuang <[email protected]>
>> Cc: David Woodhouse <[email protected]>
>> Cc: [email protected]
>> ---
>> ?drivers/mtd/nand/pxa3xx_nand.c | ? ?2 ++
>> ?1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
>> index 0c6ed72..60167d1 100644
>> --- a/drivers/mtd/nand/pxa3xx_nand.c
>> +++ b/drivers/mtd/nand/pxa3xx_nand.c
>> @@ -687,6 +687,8 @@ static int pxa3xx_nand_read_page_hwecc(struct mtd_info *mtd,
>> ? ? ? ? ? ? ? ? * OOB, ignore such double bit errors
>> ? ? ? ? ? ? ? ? */
>> ? ? ? ? ? ? ? ?if (is_buf_blank(buf, mtd->writesize))
>> + ? ? ? ? ? ? ? ? ? ? ? info->retcode = ERR_NONE;
>> + ? ? ? ? ? ? ? else
>> ? ? ? ? ? ? ? ? ? ? ? ?mtd->ecc_stats.failed++;
>> ? ? ? ?}
>>
>> --
>> 1.7.5.1
>>
>
> Acked-by: Lei Wen <[email protected]>
>

2011-06-06 10:45:11

by Artem Bityutskiy

[permalink] [raw]
Subject: Re: [PATCH] MTD: pxa3xx_nand: Fix blank page ECC mismatch

On Fri, 2011-06-03 at 23:31 +0800, Lei Wen wrote:
> Also cc to MTD mailist
> Cc: [email protected]

Please, re-send non-quoted patch.

--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)