* [PATCH 1/2] MTD: pxa3xx_nand: fix nand detection issue
@ 2011-06-07 10:01 Lei Wen
2011-06-07 10:01 ` [PATCH 2/2] MTD: pxa3xx_nand: Fix blank page ECC mismatch Lei Wen
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Lei Wen @ 2011-06-07 10:01 UTC (permalink / raw)
To: linux-arm-kernel
When keep_config is set, the detection would goes different routine.
That the driver would read out the setting which is set previously
by bootloader. While most bootloader keep the irq mask as off, and
current driver need all irq default open, keep_config behavior would
lead to no irq at all.
Signed-off-by: Lei Wen <leiwen@marvell.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Cc: stable at kernel.org
---
drivers/mtd/nand/pxa3xx_nand.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 1fb3b3a..faa0edd 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -813,7 +813,7 @@ static int pxa3xx_nand_detect_config(struct pxa3xx_nand_info *info)
info->page_size = ndcr & NDCR_PAGE_SZ ? 2048 : 512;
/* set info fields needed to read id */
info->read_id_bytes = (info->page_size == 2048) ? 4 : 2;
- info->reg_ndcr = ndcr;
+ info->reg_ndcr = ndcr & ~NDCR_INT_MASK;
info->cmdset = &default_cmdset;
info->ndtr0cs0 = nand_readl(info, NDTR0CS0);
@@ -882,7 +882,7 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd)
struct pxa3xx_nand_info *info = mtd->priv;
struct platform_device *pdev = info->pdev;
struct pxa3xx_nand_platform_data *pdata = pdev->dev.platform_data;
- struct nand_flash_dev pxa3xx_flash_ids[2] = { {NULL,}, {NULL,} };
+ struct nand_flash_dev pxa3xx_flash_ids[2], *def = NULL;
const struct pxa3xx_nand_flash *f = NULL;
struct nand_chip *chip = mtd->priv;
uint32_t id = -1;
@@ -942,8 +942,10 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd)
pxa3xx_flash_ids[0].erasesize = f->page_size * f->page_per_block;
if (f->flash_width == 16)
pxa3xx_flash_ids[0].options = NAND_BUSWIDTH_16;
+ pxa3xx_flash_ids[1].name = NULL;
+ def = pxa3xx_flash_ids;
KEEP_CONFIG:
- if (nand_scan_ident(mtd, 1, pxa3xx_flash_ids))
+ if (nand_scan_ident(mtd, 1, def))
return -ENODEV;
/* calculate addressing information */
info->col_addr_cycles = (mtd->writesize >= 2048) ? 2 : 1;
@@ -954,9 +956,9 @@ KEEP_CONFIG:
info->row_addr_cycles = 2;
mtd->name = mtd_names[0];
chip->ecc.mode = NAND_ECC_HW;
- chip->ecc.size = f->page_size;
+ chip->ecc.size = info->page_size;
- chip->options = (f->flash_width == 16) ? NAND_BUSWIDTH_16 : 0;
+ chip->options = (info->reg_ndcr & NDCR_DWIDTH_M) ? NAND_BUSWIDTH_16 : 0;
chip->options |= NAND_NO_AUTOINCR;
chip->options |= NAND_NO_READRDY;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 2/2] MTD: pxa3xx_nand: Fix blank page ECC mismatch
2011-06-07 10:01 [PATCH 1/2] MTD: pxa3xx_nand: fix nand detection issue Lei Wen
@ 2011-06-07 10:01 ` Lei Wen
2011-06-07 11:17 ` Artem Bityutskiy
2011-06-07 11:16 ` [PATCH 1/2] MTD: pxa3xx_nand: fix nand detection issue Artem Bityutskiy
2011-06-07 12:33 ` Artem Bityutskiy
2 siblings, 1 reply; 11+ messages in thread
From: Lei Wen @ 2011-06-07 10:01 UTC (permalink / raw)
To: linux-arm-kernel
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 at kernel.org
---
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 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++;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 2/2] MTD: pxa3xx_nand: Fix blank page ECC mismatch
2011-06-07 10:01 ` [PATCH 2/2] MTD: pxa3xx_nand: Fix blank page ECC mismatch Lei Wen
@ 2011-06-07 11:17 ` Artem Bityutskiy
2011-06-07 12:28 ` Lei Wen
0 siblings, 1 reply; 11+ messages in thread
From: Artem Bityutskiy @ 2011-06-07 11:17 UTC (permalink / raw)
To: linux-arm-kernel
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 at kernel.org
This was introduced in 2.6.38, so let's make it:
Cc: stable at kernel.org [2.6.38+]
--
Best Regards,
Artem Bityutskiy (????? ????????)
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH 2/2] MTD: pxa3xx_nand: Fix blank page ECC mismatch
2011-06-07 11:17 ` Artem Bityutskiy
@ 2011-06-07 12:28 ` Lei Wen
2011-06-25 11:48 ` Daniel Mack
0 siblings, 1 reply; 11+ messages in thread
From: Lei Wen @ 2011-06-07 12:28 UTC (permalink / raw)
To: linux-arm-kernel
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 at kernel.org
>
> This was introduced in 2.6.38, so let's make it:
>
> Cc: stable at kernel.org [2.6.38+]
>
Thanks for correcting this.
Best regards,
Lei
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH 2/2] MTD: pxa3xx_nand: Fix blank page ECC mismatch
2011-06-07 12:28 ` Lei Wen
@ 2011-06-25 11:48 ` Daniel Mack
2011-07-21 18:55 ` Brian Norris
0 siblings, 1 reply; 11+ messages in thread
From: Daniel Mack @ 2011-06-25 11:48 UTC (permalink / raw)
To: linux-arm-kernel
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 at kernel.org
>>
>> This was introduced in 2.6.38, so let's make it:
>>
>> Cc: stable at 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
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH 2/2] MTD: pxa3xx_nand: Fix blank page ECC mismatch
2011-06-25 11:48 ` Daniel Mack
@ 2011-07-21 18:55 ` Brian Norris
2011-07-22 8:35 ` Artem Bityutskiy
0 siblings, 1 reply; 11+ messages in thread
From: Brian Norris @ 2011-07-21 18:55 UTC (permalink / raw)
To: linux-arm-kernel
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
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/2] MTD: pxa3xx_nand: Fix blank page ECC mismatch
2011-07-21 18:55 ` Brian Norris
@ 2011-07-22 8:35 ` Artem Bityutskiy
2011-07-22 9:37 ` Artem Bityutskiy
0 siblings, 1 reply; 11+ messages in thread
From: Artem Bityutskiy @ 2011-07-22 8:35 UTC (permalink / raw)
To: linux-arm-kernel
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.
--
Best Regards,
Artem Bityutskiy
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/2] MTD: pxa3xx_nand: fix nand detection issue
2011-06-07 10:01 [PATCH 1/2] MTD: pxa3xx_nand: fix nand detection issue Lei Wen
2011-06-07 10:01 ` [PATCH 2/2] MTD: pxa3xx_nand: Fix blank page ECC mismatch Lei Wen
@ 2011-06-07 11:16 ` Artem Bityutskiy
2011-06-07 12:27 ` Lei Wen
2011-06-07 12:33 ` Artem Bityutskiy
2 siblings, 1 reply; 11+ messages in thread
From: Artem Bityutskiy @ 2011-06-07 11:16 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, 2011-06-07 at 03:01 -0700, Lei Wen wrote:
> When keep_config is set, the detection would goes different routine.
> That the driver would read out the setting which is set previously
> by bootloader. While most bootloader keep the irq mask as off, and
> current driver need all irq default open, keep_config behavior would
> lead to no irq at all.
>
> Signed-off-by: Lei Wen <leiwen@marvell.com>
> Tested-by: Daniel Mack <zonque@gmail.com>
> Cc: stable at kernel.org
When the regression was introduced? Commit id?
--
Best Regards,
Artem Bityutskiy (????? ????????)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/2] MTD: pxa3xx_nand: fix nand detection issue
2011-06-07 11:16 ` [PATCH 1/2] MTD: pxa3xx_nand: fix nand detection issue Artem Bityutskiy
@ 2011-06-07 12:27 ` Lei Wen
0 siblings, 0 replies; 11+ messages in thread
From: Lei Wen @ 2011-06-07 12:27 UTC (permalink / raw)
To: linux-arm-kernel
Hi Artem,
On Tue, Jun 7, 2011 at 7:16 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> On Tue, 2011-06-07 at 03:01 -0700, Lei Wen wrote:
>> When keep_config is set, the detection would goes different routine.
>> That the driver would read out the setting which is set previously
>> by bootloader. While most bootloader keep the irq mask as off, and
>> current driver need all irq default open, keep_config behavior would
>> lead to no irq at all.
>>
>> Signed-off-by: Lei Wen <leiwen@marvell.com>
>> Tested-by: Daniel Mack <zonque@gmail.com>
>> Cc: stable at kernel.org
>
> When the regression was introduced? Commit id?
This regression should be introduced by below commit:
commit f8155a404db95656f1519b28fdb96cb68f8b2364
Author: Lei Wen <leiwen@marvell.com>
Date: Mon Feb 28 10:32:11 2011 +0800
mtd: pxa3xx_nand: rework irq logic
So its should be:
Cc: stable at kernel.org [2.6.38+]
Best regards,
Lei
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/2] MTD: pxa3xx_nand: fix nand detection issue
2011-06-07 10:01 [PATCH 1/2] MTD: pxa3xx_nand: fix nand detection issue Lei Wen
2011-06-07 10:01 ` [PATCH 2/2] MTD: pxa3xx_nand: Fix blank page ECC mismatch Lei Wen
2011-06-07 11:16 ` [PATCH 1/2] MTD: pxa3xx_nand: fix nand detection issue Artem Bityutskiy
@ 2011-06-07 12:33 ` Artem Bityutskiy
2 siblings, 0 replies; 11+ messages in thread
From: Artem Bityutskiy @ 2011-06-07 12:33 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, 2011-06-07 at 03:01 -0700, Lei Wen wrote:
> When keep_config is set, the detection would goes different routine.
> That the driver would read out the setting which is set previously
> by bootloader. While most bootloader keep the irq mask as off, and
> current driver need all irq default open, keep_config behavior would
> lead to no irq at all.
>
> Signed-off-by: Lei Wen <leiwen@marvell.com>
> Tested-by: Daniel Mack <zonque@gmail.com>
> Cc: stable at kernel.org
Pushed both patches to l2-mtd-2.6.git, thanks.
--
Best Regards,
Artem Bityutskiy (????? ????????)
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2011-07-22 9:37 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-07 10:01 [PATCH 1/2] MTD: pxa3xx_nand: fix nand detection issue Lei Wen
2011-06-07 10:01 ` [PATCH 2/2] MTD: pxa3xx_nand: Fix blank page ECC mismatch Lei Wen
2011-06-07 11:17 ` Artem Bityutskiy
2011-06-07 12:28 ` Lei Wen
2011-06-25 11:48 ` Daniel Mack
2011-07-21 18:55 ` Brian Norris
2011-07-22 8:35 ` Artem Bityutskiy
2011-07-22 9:37 ` Artem Bityutskiy
2011-06-07 11:16 ` [PATCH 1/2] MTD: pxa3xx_nand: fix nand detection issue Artem Bityutskiy
2011-06-07 12:27 ` Lei Wen
2011-06-07 12:33 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).