possible bug in nandsim
Hi
I've recently started working with the nand simulator. For my testing purposes I have to use it with a cache file. Bellow are the commands I run:
modprobe nandsim first_id_byte=0x20 second_id_byte=0xaa third_id_byte=0x00 fourth_id_byte=0x15 cache_file=cache_file.txt modprobe ubi mtd=0 fm_autoconvert=1
Unfortunately, when trying the above I noticed that the next time i load nandsim and ubi on top of it the fastmap data is not saved at cache_file.txt and the device comes up as clean. Meaning, the cache file feature of the nandsim isn't working properly.
So while debugging this I think I found the root cause:
unsigned long *pages_written from struct nandsim also needs saving. Otherwise while reading a page (at read_page()) we enter the following code flow:
if (!test_bit(ns->regs.row, ns->pages_written)) {
memset(ns->buf.byte, 0xFF, num);
} else {thus, ignoring the content of the cache file.
I've fixed this internally in my build by just saving the content of pages_written to a file on __exit and reading from that file on __init.
I was wondering if someone had done this in a more elegant way perhaps?
If not, I'll beautify my patch and share.
Thanks,
Tanya Brokhman
Signature · 2 lines
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Quoted 5 lines · Tanya Brokhman
Hi
I've recently started working with the nand simulator. For my testing purposes I have to use it with a cache file. Bellow are the commands I run:
Quoted 8 lines
modprobe nandsim first_id_byte=0x20 second_id_byte=0xaa third_id_byte=0x00 fourth_id_byte=0x15 cache_file=cache_file.txt
modprobe ubi mtd=0 fm_autoconvert=1Unfortunately, when trying the above I noticed that the next time i load nandsim and ubi on top of it the fastmap data is not saved at cache_file.txt and the device comes up as clean. Meaning, the cache file feature of the nandsim isn't working properly.
IIRC this feature is really meant as a cache and not persistent storage.
Quoted 27 lines
So while debugging this I think I found the root cause:
unsigned long*pages_writtenfrom struct nandsim also needs saving. Otherwise while reading a page (atread_page()) we enter the following code flow:if (!test_bit(ns->regs.row, ns->pages_written)) { memset(ns->buf.byte, 0xFF, num); } else {thus, ignoring the content of the cache file.
I've fixed this internally in my build by just saving the content of
pages_writtento a file on__exitand reading from that file on__init.I was wondering if someone had done this in a more elegant way perhaps?
If not, I'll beautify my patch and share.
Thanks,
Tanya Brokhman
--
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Signature · 2 lines
Thanks, //richard
Hello Richard, Tanya:
Quoted 10 lines · Richard Weinberger
Quoted 9 lines · Tanya Brokhman
Hi
I've recently started working with the nand simulator. For my testing purposes I have to use it with a cache file. Bellow are the commands I run:
modprobe nandsim first_id_byte=0x20 second_id_byte=0xaa third_id_byte=0x00 fourth_id_byte=0x15 cache_file=cache_file.txt
modprobe ubi mtd=0 fm_autoconvert=1
Quoted 7 lines
Quoted 4 lines
Unfortunately, when trying the above I noticed that the next time i load nandsim and ubi on top of it the fastmap data is not saved at cache_file.txt and the device comes up as clean. Meaning, the cache file feature of the nandsim isn't working properly.
IIRC this feature is really meant as a cache and not persistent storage.
AFAIK Richard is right, the feature is just a non-persistent cache.
However a patch was submitted (and never reviewed) recently to apparently add persistent behavior:
http://patchwork.ozlabs.org/patch/277974/
Tanya: Can you test or review the patch and provide a formal Tested/Reviewed-by? I'd be interested in seeing that move forward :)
Thanks!
Signature · 3 lines
Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com
Hello Ezequiel,
Quoted 5 lines · Ezequiel Garcia
AFAIK Richard is right, the feature is just a non-persistent cache.
However a patch was submitted (and never reviewed) recently to apparently add persistent behavior:
Quoted 7 lines
http://patchwork.ozlabs.org/patch/277974/Tanya: Can you test or review the patch and provide a formal Tested/Reviewed-by? I'd be interested in seeing that move forward :)
Thanks!
This is exactly the behavior I need for my testing purposes! Thank you. At the moment I have that with my (ugly) fix. I will try to validate your patch and help it get integrated.
Signature · 2 lines
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Quoted 10 lines · Tanya Brokhman
Hello Ezequiel,
Quoted 7 lines · Ezequiel Garcia
AFAIK Richard is right, the feature is just a non-persistent cache.
However a patch was submitted (and never reviewed) recently to apparently add persistent behavior:
http://patchwork.ozlabs.org/patch/277974/
Quoted 7 lines
Quoted 5 lines
Tanya: Can you test or review the patch and provide a formal Tested/Reviewed-by? I'd be interested in seeing that move forward :)
Thanks!
This is exactly the behavior I need for my testing purposes! Thank you.
You're welcome.
Quoted 3 lines
At the moment I have that with my (ugly) fix. I will try to validate your patch and help it get integrated.
FWIW: it's not "my" patch.
Signature · 3 lines
Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com
Hi Richard
Sorry for taking so long but I got to testing your patch just now. Unfortunately the device crashes as soon as soon as I try to load nandsim:
modprobe nandsim first_id_byte=0x20 second_id_byte=0xaa third_id_byte=0x00 fourth_id_byte=0x15 cache_file=cashe_file.txt cache_file_written=1
dmesg:
[ 202.110263] BUG: unable to handle kernel paging request at d88fb000 [ 202.111018] IP: [<d88f3a4c>] ns_init_module+0xa4c/0xcdc [nandsim] [ 202.111018] *pde = 1780f067 *pte = 00000000 [ 202.111018] Oops: 0002 [#1] SMP [ 202.111018] Modules linked in: nandsim(+) [ 202.111018] CPU: 0 PID: 1531 Comm: modprobe Not tainted 3.14.0-rc2-next-20140212+ #183 [ 202.111018] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007 [ 202.111018] task: d79e2e80 ti: d6c68000 task.ti: d6c68000 [ 202.111018] EIP: 0060:[<d88f3a4c>] EFLAGS: 00010202 CPU: 0 [ 202.111018] EIP is at ns_init_module+0xa4c/0xcdc [nandsim] [ 202.111018] EAX: d781f4ff EBX: d781f1d8 ECX: 0001c000 EDX: d88f7000 [ 202.111018] ESI: d781f414 EDI: d88fb000 EBP: d6c69e24 ESP: d6c69dcc [ 202.111018] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 [ 202.111018] CR0: 8005003b CR2: d88fb000 CR3: 16e6a000 CR4: 00000690 [ 202.111018] Stack: [ 202.111018] d88eefb8 00000008 00000000 00000000 00000000 d781f1d8 194bce9c 0000002f [ 202.111018] 194b37e7 00000040 d781f1d8 00000000 d781f414 d6c69e08 10000000 00000000 [ 202.111018] d6c443c0 00000000 d6c69e24 d6c69f60 00000000 00000000 d6c69e94 c1000360 [ 202.111018] Call Trace: [ 202.111018] [<c1000360>] do_one_initcall+0x30/0x140 [ 202.111018] [<c10bff71>] ? tracepoint_module_notify+0x121/0x180 [ 202.111018] [<d88f3000>] ? 0xd88f2fff [ 202.111018] [<c1764003>] ? notifier_call_chain+0x43/0x60 [ 202.111018] [<c1061c84>] ? __blocking_notifier_call_chain+0x54/0x70 [ 202.111018] [<c10a5def>] load_module+0x14bf/0x1920 [ 202.111018] [<c10a3130>] ? mod_kobject_put+0x40/0x40 [ 202.111018] [<c10a6383>] SyS_init_module+0xa3/0xc0 [ 202.111018] [<c1767c5a>] sysenter_do_call+0x12/0x22 [ 202.111018] Code: 04 24 10 0b 8f d8 bf f4 ff ff ff e8 d8 91 e6 e8 e9 04 01 00 00 83 3d 40 13 8f d8 00 74 0f 8b 45 d8 89 d7 8b 88 d4 03 00 00 b0 ff <f3> aa 8b 55 d8 8b 82 cc 03 00 00 ba d0 00 00 00 e8 cf 73 83 e8 [ 202.111018] EIP: [<d88f3a4c>] ns_init_module+0xa4c/0xcdc [nandsim] SS:ESP 0068:d6c69dcc [ 202.111018] CR2: 00000000d88fb000 [ 202.111018] ---[ end trace cdb11d3383abc7cc ]---
Thanks
Tanya
Quoted 33 lines · Ezequiel Garcia
Hello Richard, Tanya:
Quoted 10 lines · Richard Weinberger
Quoted 9 lines · Tanya Brokhman
Hi
I've recently started working with the nand simulator. For my testing purposes I have to use it with a cache file. Bellow are the commands I run:
modprobe nandsim first_id_byte=0x20 second_id_byte=0xaa third_id_byte=0x00 fourth_id_byte=0x15 cache_file=cache_file.txt
modprobe ubi mtd=0 fm_autoconvert=1Quoted 7 lines
Quoted 4 lines
Unfortunately, when trying the above I noticed that the next time i load nandsim and ubi on top of it the fastmap data is not saved at cache_file.txt and the device comes up as clean. Meaning, the cache file feature of the nandsim isn't working properly.
IIRC this feature is really meant as a cache and not persistent storage.
AFAIK Richard is right, the feature is just a non-persistent cache.
However a patch was submitted (and never reviewed) recently to apparently add persistent behavior:
http://patchwork.ozlabs.org/patch/277974/Tanya: Can you test or review the patch and provide a formal Tested/Reviewed-by? I'd be interested in seeing that move forward :)
Thanks!
Signature · 2 lines
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Richard Weinberger
maintainerAm 12.02.2014 10:51, schrieb Tanya Brokhman:
Quoted 3 lines
Hi Richard
Sorry for taking so long but I got to testing your patch just now.
What patch?
*confused*,
//richard
Quoted 10 lines · Richard Weinberger
Am 12.02.2014 10:51, schrieb Tanya Brokhman:
Quoted 3 lines
Hi Richard
Sorry for taking so long but I got to testing your patch just now.
What patch?
*confused*,
//richard
I think Tanya means my patch
(http://patchwork.ozlabs.org/patch/277974/) that Ezequiel Garcia previously pointed out (see list mails under this subject from 2013-11-07).
yes, was referring to http://patchwork.ozlabs.org/patch/277974/. sorry
Quoted 21 lines · Matthew Gabeler-Lee
Quoted 10 lines · Richard Weinberger
Am 12.02.2014 10:51, schrieb Tanya Brokhman:
Quoted 3 lines
Hi Richard
Sorry for taking so long but I got to testing your patch just now.
What patch?
*confused*,
//richardI think Tanya means my patch
(http://patchwork.ozlabs.org/patch/277974/) that Ezequiel Garcia previously pointed out (see list mails under this subject from 2013-11-07).______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Signature · 2 lines
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Hi Tanya,
Quoted 2 lines · Tanya Brokhman
yes, was referring to http://patchwork.ozlabs.org/patch/277974/. sorry
I'm sure you're smart enough to see nobody top-posts around here.
Why are *you* doing it?
Quoted 10 lines · Matthew Gabeler-Lee
Quoted 9 lines · Richard Weinberger
Quoted 8 lines
Am 12.02.2014 10:51, schrieb Tanya Brokhman:
Quoted 3 lines
Hi Richard
Sorry for taking so long but I got to testing your patch just now.
What patch?
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
*confused*,
//richardI think Tanya means my patch
(http://patchwork.ozlabs.org/patch/277974/) that Ezequiel Garcia previously pointed out (see list mails under this subject from 2013-11-07).
See? We're all replying *after* the mail we want to reply to.
Signature · 3 lines
Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com
Quoted 23 lines · Ezequiel Garcia
Hi Tanya,
Quoted 2 lines · Tanya Brokhman
yes, was referring to http://patchwork.ozlabs.org/patch/277974/. sorry
I'm sure you're smart enough to see nobody top-posts around here.
Why are *you* doing it?
Quoted 13 lines · Matthew Gabeler-Lee
Quoted 12 lines · Richard Weinberger
Quoted 10 lines
Am 12.02.2014 10:51, schrieb Tanya Brokhman:
Quoted 3 lines
Hi Richard
Sorry for taking so long but I got to testing your patch just now.
What patch?
*confused*,
//richard
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
I think Tanya means my patch
(http://patchwork.ozlabs.org/patch/277974/) that Ezequiel Garcia previously pointed out (see list mails under this subject from 2013-11-07).See? We're all replying *after* the mail we want to reply to.
A habit. Wasn't aware of the fact that this is such an issue. wont happen again. Sorry if it offended anyone.
Signature · 2 lines
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation