diff mbox

[2/2] MTD: pxa3xx_nand: Fix blank page ECC mismatch

Message ID 1307440867-18993-2-git-send-email-leiwen@marvell.com
State Accepted
Commit 543e32d5ff165d0d68deedb0e3557478c7c36a4a
Headers show

Commit Message

Lei Wen June 7, 2011, 10:01 a.m. UTC
From: Daniel Mack <zonque@gmail.com>

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 <zonque@gmail.com>
Acked-by: Lei Wen <leiwen@marvell.com>
Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
Cc: David Woodhouse <David.Woodhouse@intel.com>
Cc: stable@kernel.org
---
 drivers/mtd/nand/pxa3xx_nand.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Artem Bityutskiy June 7, 2011, 11:17 a.m. UTC | #1
On Tue, 2011-06-07 at 03:01 -0700, Lei Wen wrote:
> From: Daniel Mack <zonque@gmail.com>
> 
> 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 <zonque@gmail.com>
> Acked-by: Lei Wen <leiwen@marvell.com>
> Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
> Cc: David Woodhouse <David.Woodhouse@intel.com>
> Cc: stable@kernel.org

This was introduced in 2.6.38, so let's make it:

Cc: stable@kernel.org [2.6.38+]
Lei Wen June 7, 2011, 12:28 p.m. UTC | #2
On Tue, Jun 7, 2011 at 7:17 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> On Tue, 2011-06-07 at 03:01 -0700, Lei Wen wrote:
>> From: Daniel Mack <zonque@gmail.com>
>>
>> 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 <zonque@gmail.com>
>> Acked-by: Lei Wen <leiwen@marvell.com>
>> Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
>> Cc: David Woodhouse <David.Woodhouse@intel.com>
>> Cc: stable@kernel.org
>
> This was introduced in 2.6.38, so let's make it:
>
> Cc: stable@kernel.org [2.6.38+]
>
Thanks for correcting this.

Best regards,
Lei
Daniel Mack June 25, 2011, 11:48 a.m. UTC | #3
On Tue, Jun 7, 2011 at 2:28 PM, Lei Wen <adrian.wenl@gmail.com> wrote:
> On Tue, Jun 7, 2011 at 7:17 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
>> On Tue, 2011-06-07 at 03:01 -0700, Lei Wen wrote:
>>> From: Daniel Mack <zonque@gmail.com>
>>>
>>> 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 <zonque@gmail.com>
>>> Acked-by: Lei Wen <leiwen@marvell.com>
>>> Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
>>> Cc: David Woodhouse <David.Woodhouse@intel.com>
>>> Cc: stable@kernel.org
>>
>> This was introduced in 2.6.38, so let's make it:
>>
>> Cc: stable@kernel.org [2.6.38+]
>>
> Thanks for correcting this.

Has anyone queued this for 3.0 yet? This fixes a serious regression,
so we need this merged, along with Lei's other patch titled "MTD:
pxa3xx_nand: fix nand detection issue".


Thanks,
Daniel
Brian Norris July 21, 2011, 6:55 p.m. UTC | #4
On Sat, Jun 25, 2011 at 4:48 AM, Daniel Mack <zonque@gmail.com> wrote:
> Has anyone queued this for 3.0 yet? This fixes a serious regression,
> so we need this merged, along with Lei's other patch titled "MTD:
> pxa3xx_nand: fix nand detection issue".

Hmm, I'm a little late on this one...I was just sorting through a few
e-mails and saw this one.

It looks like it made it as far as Artem's l2-mtd-2.6.git:
http://git.infradead.org/users/dedekind/l2-mtd-2.6.git/commit/e119967aad8df3b87834e28249feca696c650647

but things have been sitting there for months now. I believe every so
often, dwmw sorts through Artem's l2-mtd-2.6 repo, pulls patches into
mtd-2.6, and gets them merged upstream. I think the last time this
happened was early June (between v3.0-rc1 and v3.0-rc2). Once such
patches hit mainline, then the stable team is alerted and the
appropriately-labeled patches are sent to the stable repos. Don't know
when this will happen though. I'm kinda wondering myself...

Brian
Artem Bityutskiy July 22, 2011, 8:35 a.m. UTC | #5
On Thu, 2011-07-21 at 11:55 -0700, Brian Norris wrote:
> On Sat, Jun 25, 2011 at 4:48 AM, Daniel Mack <zonque@gmail.com> wrote:
> > Has anyone queued this for 3.0 yet? This fixes a serious regression,
> > so we need this merged, along with Lei's other patch titled "MTD:
> > pxa3xx_nand: fix nand detection issue".
> 
> Hmm, I'm a little late on this one...I was just sorting through a few
> e-mails and saw this one.
> 
> It looks like it made it as far as Artem's l2-mtd-2.6.git:
> http://git.infradead.org/users/dedekind/l2-mtd-2.6.git/commit/e119967aad8df3b87834e28249feca696c650647
> 
> but things have been sitting there for months now. I believe every so
> often, dwmw sorts through Artem's l2-mtd-2.6 repo, pulls patches into
> mtd-2.6, and gets them merged upstream. I think the last time this
> happened was early June (between v3.0-rc1 and v3.0-rc2). Once such
> patches hit mainline, then the stable team is alerted and the
> appropriately-labeled patches are sent to the stable repos. Don't know
> when this will happen though. I'm kinda wondering myself...

My guess is that this patch will reach upstream only when the linux-3.1
merge window opens.
Artem Bityutskiy July 22, 2011, 9:37 a.m. UTC | #6
On Fri, 2011-07-22 at 11:35 +0300, Artem Bityutskiy wrote:
> My guess is that this patch will reach upstream only when the linux-3.1
> merge window opens.

And it is open now :-)
diff mbox

Patch

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index faa0edd..30689cc 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -685,6 +685,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++;
 	}