* [PATCH] mtd cs553x_nand: Initialise ecc.strength before nand_scan()
@ 2012-11-21 23:42 Nathan Williams
2012-11-22 4:08 ` Brian Norris
2012-11-22 11:09 ` Artem Bityutskiy
0 siblings, 2 replies; 4+ messages in thread
From: Nathan Williams @ 2012-11-21 23:42 UTC (permalink / raw)
To: linux-mtd; +Cc: linux-kernel
Loading cs553x_nand with Hynix H27U1G8F2BTR NAND flash causes this bug:
kernel BUG at drivers/mtd/nand/nand_base.c:3345!
invalid opcode: 0000 [#1]
Modules linked in: cs553x_nand(+) vfat fat usb_storage ehci_hcd usbcore usb_comr
Pid: 436, comm: modprobe Not tainted 3.6.7 #1
EIP: 0060:[<c118d205>] EFLAGS: 00010296 CPU: 0
EIP is at nand_scan_tail+0x64c/0x69c
EAX: 00000034 EBX: cea6ed98 ECX: 00000000 EDX: 00000000
ESI: cea6ec00 EDI: cea6ec00 EBP: 20000000 ESP: cdd17e48
DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068
CR0: 8005003b CR2: 0804e119 CR3: 0d850000 CR4: 00000090
DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
DR6: ffff0ff0 DR7: 00000400
Process modprobe (pid: 436, ti=cdd16000 task=cdd1c320 task.ti=cdd16000)
Stack:
c12e962c c118f7ef 00000003 cea6ed98 d014b25c 20000000 fffff007 00000001
00000000 cdd53b00 d014b000 c1001021 cdd53b00 d01493c0 cdd53b00 cdd53b00
d01493c0 c1047f83 d014b4a0 00000000 cdd17f9c ce4be454 cdd17f48 cdd1c320
Call Trace:
[<c118f7ef>] ? nand_scan+0x1b/0x4d
[<d014b25c>] ? init_module+0x25c/0x2de [cs553x_nand]
[<d014b000>] ? 0xd014afff
[<c1001021>] ? do_one_initcall+0x21/0x111
[<c1047f83>] ? sys_init_module+0xe4/0x1261
[<c1031207>] ? task_work_run+0x36/0x43
[<c1265ced>] ? syscall_call+0x7/0xb
Code: fa ff ff c7 86 d8 00 00 00 01 00 00 00 e9 5f fc ff ff 68 f8 26 2e c1 e8 a7
EIP: [<c118d205>] nand_scan_tail+0x64c/0x69c SS:ESP 0068:cdd17e48
Initialising ecc.strength before the call to nand_scan() fixes this.
Signed-off-by: Nathan Williams <nathan@traverse.com.au>
---
drivers/mtd/nand/cs553x_nand.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/cs553x_nand.c b/drivers/mtd/nand/cs553x_nand.c
index adb6c3e..2cdeab8 100644
--- a/drivers/mtd/nand/cs553x_nand.c
+++ b/drivers/mtd/nand/cs553x_nand.c
@@ -237,6 +237,7 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr)
this->ecc.hwctl = cs_enable_hwecc;
this->ecc.calculate = cs_calculate_ecc;
this->ecc.correct = nand_correct_data;
+ this->ecc.strength = 1;
/* Enable the following for a flash based bad block table */
this->bbt_options = NAND_BBT_USE_FLASH;
@@ -247,8 +248,6 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr)
goto out_ior;
}
- this->ecc.strength = 1;
-
new_mtd->name = kasprintf(GFP_KERNEL, "cs553x_nand_cs%d", cs);
cs553x_mtd[cs] = new_mtd;
--
1.7.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd cs553x_nand: Initialise ecc.strength before nand_scan()
2012-11-21 23:42 [PATCH] mtd cs553x_nand: Initialise ecc.strength before nand_scan() Nathan Williams
@ 2012-11-22 4:08 ` Brian Norris
2012-11-27 18:11 ` Mike Dunn
2012-11-22 11:09 ` Artem Bityutskiy
1 sibling, 1 reply; 4+ messages in thread
From: Brian Norris @ 2012-11-22 4:08 UTC (permalink / raw)
To: Nathan Williams; +Cc: linux-mtd, linux-kernel, Mike Dunn, Artem Bityutskiy
On Wed, Nov 21, 2012 at 3:42 PM, Nathan Williams <nathan@traverse.com.au> wrote:
> Loading cs553x_nand with Hynix H27U1G8F2BTR NAND flash causes this bug:
>
> kernel BUG at drivers/mtd/nand/nand_base.c:3345!
...
> Initialising ecc.strength before the call to nand_scan() fixes this.
Acked-by: Brian Norris <computersforpeace@gmail.com>
BTW, I made a quick read through of the other NAND drivers to look for
similar errors. I think this is the only one where the only
ecc.strenght initialization occurred after the nand_scan() or
nand_scan_tail() call.
Thanks,
Brian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd cs553x_nand: Initialise ecc.strength before nand_scan()
2012-11-21 23:42 [PATCH] mtd cs553x_nand: Initialise ecc.strength before nand_scan() Nathan Williams
2012-11-22 4:08 ` Brian Norris
@ 2012-11-22 11:09 ` Artem Bityutskiy
1 sibling, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2012-11-22 11:09 UTC (permalink / raw)
To: Nathan Williams; +Cc: linux-mtd, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 309 bytes --]
On Thu, 2012-11-22 at 10:42 +1100, Nathan Williams wrote:
> Loading cs553x_nand with Hynix H27U1G8F2BTR NAND flash causes this bug:
>
> kernel BUG at drivers/mtd/nand/nand_base.c:3345!
Pushed to l2-mtd.git, added
Cc: stable@vgen.kernel.org [3.4+]
Thanks!
--
Best Regards,
Artem Bityutskiy
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd cs553x_nand: Initialise ecc.strength before nand_scan()
2012-11-22 4:08 ` Brian Norris
@ 2012-11-27 18:11 ` Mike Dunn
0 siblings, 0 replies; 4+ messages in thread
From: Mike Dunn @ 2012-11-27 18:11 UTC (permalink / raw)
To: Brian Norris; +Cc: Nathan Williams, linux-mtd, linux-kernel, Artem Bityutskiy
On 11/21/2012 08:08 PM, Brian Norris wrote:
> On Wed, Nov 21, 2012 at 3:42 PM, Nathan Williams <nathan@traverse.com.au> wrote:
>> Loading cs553x_nand with Hynix H27U1G8F2BTR NAND flash causes this bug:
>>
>> kernel BUG at drivers/mtd/nand/nand_base.c:3345!
> ...
>> Initialising ecc.strength before the call to nand_scan() fixes this.
>
> Acked-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Mike Dunn <mikedunn@newsguy.com>
>
> BTW, I made a quick read through of the other NAND drivers to look for
> similar errors. I think this is the only one where the only
> ecc.strenght initialization occurred after the nand_scan() or
> nand_scan_tail() call.
Thanks for that Brian. I thought I did this when another driver had a similiar
problem a while back. Maybe I just intended to :(
Mike
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-11-27 18:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-21 23:42 [PATCH] mtd cs553x_nand: Initialise ecc.strength before nand_scan() Nathan Williams
2012-11-22 4:08 ` Brian Norris
2012-11-27 18:11 ` Mike Dunn
2012-11-22 11:09 ` 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).