Skip to contentSkip to conversation

MTD: pxa3xx_nand: Fix blank page ECC mismatch

PATCH In review Daniel Mack 3 participants 4 messages Jun 3, 2011 – Jun 6, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

Cc Lei Wen <[email protected]>
Cc Haojian Zhuang <[email protected]>
Cc David Woodhouse <[email protected]>
Cc stable at kernel.org
---
 drivers/mtd/nand/pxa3xx_nand.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/mtd/nand/pxa3xx_nand.c +2 -0
index 0c6ed72..60167d1 100644
@@ -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++;
 	}
 
Signature · 1 line
1.7.5.1
Acked-by on v1 1/1
#1 lore raw
Quoted 30 lines · Daniel Mack

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.

Cc Lei Wen <[email protected]>
Cc Haojian Zhuang <[email protected]>
Cc David Woodhouse <[email protected]>
Cc stable at kernel.org

---
?drivers/mtd/nand/pxa3xx_nand.c | ? ?2 ++
?1 files changed, 2 insertions(+), 0 deletions(-)

drivers/mtd/nand/pxa3xx_nand.c +0 -0
index 0c6ed72..60167d1 100644
@@ -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++; ? ? ? ?}

Quoted 3 lines

--
1.7.5.1

#2 lore raw

Also cc to MTD mailist
Cc: linux-mtd at lists.infradead.org

Quoted 37 lines · Lei Wen
Quoted 30 lines · Daniel Mack

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.

Cc Lei Wen <[email protected]>
Cc Haojian Zhuang <[email protected]>
Cc David Woodhouse <[email protected]>
Cc stable at kernel.org

---
?drivers/mtd/nand/pxa3xx_nand.c | ? ?2 ++
?1 files changed, 2 insertions(+), 0 deletions(-)

drivers/mtd/nand/pxa3xx_nand.c +0 -0
index 0c6ed72..60167d1 100644
@@ -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++; ? ? ? ?}

Quoted 3 lines

--
1.7.5.1

#3 lore raw
Quoted 2 lines · Lei Wen

Also cc to MTD mailist
Cc: linux-mtd at lists.infradead.org

Please, re-send non-quoted patch.

Signature · 2 lines
Best Regards,
Artem Bityutskiy (????? ????????)