* Why nandwrite success but mount complain?
@ 2005-04-21 10:16 carl liao
2005-04-21 10:48 ` Artem B. Bityuckiy
2005-04-21 11:16 ` Kluba Patrik
0 siblings, 2 replies; 3+ messages in thread
From: carl liao @ 2005-04-21 10:16 UTC (permalink / raw)
To: linux mtd
--------------------------------------------------------------------------------
Hi,
My kernel is 2.4.26 mipsel with mtd snapshot 20050416. I erase and program my
nand device this way:
# flash_eraseall -j /dev/mtd/3
# mkfs.jffs2 -n -e 16KiB -m none -o nddemo.jffs2 -d /demo
# nandwrite -p /dev/mtd/3 nddemo.jffs2
# mount /dev/mtdblock/3 /mnt
The mount did succeed! But there are some dumping messeges and ECC errors.
After mounted, some of programs under /mnt could be executed correctly but some
others couldn't.
The error messages are like the following during mounting a NAND partition:
#mount /dev/mtdblock3 /mnt
......
--> mtd->read(0x400 bytes from 0xc000) returned ECC error
--> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000c154:
0x05b7 instead
--> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000c158:
0x83a0 instead
......
I nanddump the data from /dev/mtd/3 to a file nandmtd3.dump and look at it:
--> 0x0000c150: 12 00 0b 00 b7 05 00 00 a0 83 41 00 00 00 00 00
I hexedit my JFFS2 image nddemo.jffs2 and look at it:
--> 0x0000c150: 8C 48 44 00 85 19 02 E0 44 10 00 00 6D 58 D1 84
The data indicate the complaints from while mounting JFFS2 is really
justified!
Then why nandwrite programing most of data within nddemo.jffs2 correctly but
not all of them? BTW, my nddemo.jffs2 is about 8MB.
Which codes should I dig into:
1) NAND Flash drvier?
2) NAND Flash core layer?
3) JFFS2 wbuf.c and other JFFS2 codes in the kernel?
4) the nandwrite program itself?
Please give me some suggestions. Thanks!
Carl Liao
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Why nandwrite success but mount complain?
2005-04-21 10:16 Why nandwrite success but mount complain? carl liao
@ 2005-04-21 10:48 ` Artem B. Bityuckiy
2005-04-21 11:16 ` Kluba Patrik
1 sibling, 0 replies; 3+ messages in thread
From: Artem B. Bityuckiy @ 2005-04-21 10:48 UTC (permalink / raw)
To: carl liao; +Cc: linux mtd
On Thu, 2005-04-21 at 18:16 +0800, carl liao wrote:
> Which codes should I dig into:
> 1) NAND Flash drvier?
> 2) NAND Flash core layer?
> 3) JFFS2 wbuf.c and other JFFS2 codes in the kernel?
> 4) the nandwrite program itself?
>
I suspect 1.
--
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Why nandwrite success but mount complain?
2005-04-21 10:16 Why nandwrite success but mount complain? carl liao
2005-04-21 10:48 ` Artem B. Bityuckiy
@ 2005-04-21 11:16 ` Kluba Patrik
1 sibling, 0 replies; 3+ messages in thread
From: Kluba Patrik @ 2005-04-21 11:16 UTC (permalink / raw)
To: carl liao; +Cc: linux mtd
This "bug" relates to JFFS2.
User space tools are able to build a file system using 16KiB erase block size,
but the kernel part of JFFS2 itself does not support it.
This is because JFFS2 uses kmalloc for allocating memory for jffs2_eraseblock
structs. Smaller erase block size means more of this and more memory needed for
storage. And kmalloc allows max. 128K allocations. (using 32K block size instead
of 16K block size halves the memory requirements)
See jffs2_do_fill_super in fs.c
It's not very easy to circumvent this problem. Memory allocation and handling of
jffs2_eraseblocks should be modified.
Bye,
Patrik Kluba
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-04-21 11:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-21 10:16 Why nandwrite success but mount complain? carl liao
2005-04-21 10:48 ` Artem B. Bityuckiy
2005-04-21 11:16 ` Kluba Patrik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox