* UBIFS: problems writing to the partition
@ 2009-11-25 12:03 Alemao
2009-11-26 7:32 ` Artem Bityutskiy
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Alemao @ 2009-11-25 12:03 UTC (permalink / raw)
To: linux-mtd
Hi all,
I have de following scenario:
- Freescale MPC8541
- U-Boot-2009.03
- Linux-2.6.26
- NAND flash 512Mbit (64MB), page: 512 bytes, erase block: 16KB
And Im creating UBI image with this parameters:
mkfs.ubifs -r rootfs/ -m 512 -c 3897 -e 15872 -o ubi.temp
ubinize -o rootfs.ubifs -m 512 -p 16384 -s 256 ubinize.cfg
My ubinize.cfg
[ubifs]
mode=ubi
image=ubi.temp
vol_id=0
vol_size=60MiB
vol_type=dynamic
vol_name=ubipart
vol_alignment=1
vol_flags=autoresize
Im loading the linux kernel from UBIFS partition in U-Boot and
mounting again in kernel with no problem:
# mount -t ubifs -o rw ubi0!ubipart /mnt/nand
UBIFS: mounted UBI device 0, volume 0, name "ubipart"
UBIFS: file system size: 61392896 bytes (59954 KiB, 58 MiB, 3868 LEBs)
UBIFS: journal size: 8015360 bytes (7827 KiB, 7 MiB, 505 LEBs)
UBIFS: media format: 4 (latest is 4)
UBIFS: default compressor: lzo
UBIFS: reserved for root: 0 bytes (0 KiB)
# ls /mnt/nand/
cfg www logs readme.txt
But when I try to write something...
# echo hi > /mnt/nand/hi.txt
UBI error: paranoid_check_peb_vid_hdr: bad VID header CRC at PEB 0,
calculated 0xb730eb2, read 0xffffffff
UBI error: paranoid_check_peb_vid_hdr: paranoid check failed for PEB 0
Call Trace:
[df003c20] [c0006a4c] show_stack+0x50/0x170 (unreliable)
[df003c50] [c01bad88] ubi_io_write+0x258/0x354
[df003c90] [c01b8c34] ubi_eba_write_leb+0xd8/0x654
[df003ce0] [c01b7568] ubi_leb_write+0x11c/0x140
[df003d10] [c011fd28] dbg_leb_write+0xc0/0xe8
[df003d40] [c00ff1ac] ubifs_wbuf_write_nolock+0x338/0x544
[df003d70] [c00f2804] ubifs_jnl_write_data+0x23c/0x2c0
[df003db0] [c00f5510] do_writepage+0xb8/0x1cc
[df003df0] [c0049c3c] __writepage+0x24/0x68
[df003e00] [c004ace0] write_cache_pages+0x1c0/0x334
[df003e90] [c004aecc] do_writepages+0x50/0x78
[df003ea0] [c0044248] __filemap_fdatawrite_range+0x7c/0x98
[df003f00] [c0084520] do_fsync+0x3c/0xb0
[df003f20] [c00845c0] __do_fsync+0x2c/0x50
[df003f40] [c000d134] ret_from_syscall+0x0/0x3c
UBI warning: ubi_eba_write_leb: failed to write data to PEB 0
UBI warning: ubi_ro_mode: switch to read-only mode
UBIFS error (pid 13868): ubifs_wbuf_write_nolock: cannot write 2289
bytes to LEB 2896:0, error -22
Dont know if Im creating the image with the right parameters.
One thing that I notice is that when I DONT load the kernel from UBIFS
in U-Boot, I can write to the partition in kernel with no problem. But
after a reboot, I got some recovery messages:
# mount -t ubifs -o rw ubi0!ubipart /mnt/nand
UBIFS: recovery needed
UBIFS: recovery completed
UBIFS: mounted UBI device 0, volume 0, name "ubipart"
UBIFS: file system size: 61392896 bytes (59954 KiB, 58 MiB, 3868 LEBs)
UBIFS: journal size: 8015360 bytes (7827 KiB, 7 MiB, 505 LEBs)
UBIFS: media format: 4 (latest is 4)
UBIFS: default compressor: lzo
UBIFS: reserved for root: 0 bytes (0 KiB)
Here some messages from UBIFS kernel initialization:
NAND device: Manufacturer ID: 0x20, Chip ID: 0x76 (ST Micro NAND 64MiB
3,3V 8-bit)
Scanning device for bad blocks
Creating 1 MTD partitions on "60000000.nand":
0x00000000-0x04000000 : "ubipart"
UBI: attaching mtd3 to ubi0
UBI: physical eraseblock size: 16384 bytes (16 KiB)
UBI: logical eraseblock size: 15872 bytes
UBI: smallest flash I/O unit: 512
UBI: sub-page size: 256
UBI: VID header offset: 256 (aligned 256)
UBI: data offset: 512
UBI: attached mtd3 to ubi0
UBI: MTD device name: "ubipart"
UBI: MTD device size: 64 MiB
UBI: number of good PEBs: 4096
UBI: number of bad PEBs: 0
UBI: max. allowed volumes: 92
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 1
UBI: available PEBs: 0
UBI: total number of reserved PEBs: 4096
UBI: number of PEBs reserved for bad PEB handling: 40
UBI: max/mean erase counter: 2/0
And my bootargs (U-Boot):
root=/dev/ram rw console=ttyS0,115200 ubi.mtd=3
or
root=/dev/ram console=ttyS0,115200 ubi.mtd=3
Any ideas about what could be happening?
Thanks in advance,
--
Alemao
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: UBIFS: problems writing to the partition
2009-11-25 12:03 UBIFS: problems writing to the partition Alemao
@ 2009-11-26 7:32 ` Artem Bityutskiy
2009-11-26 15:32 ` Alemao
2009-11-27 8:03 ` Adrian Hunter
2009-11-30 8:55 ` Artem Bityutskiy
2 siblings, 1 reply; 6+ messages in thread
From: Artem Bityutskiy @ 2009-11-26 7:32 UTC (permalink / raw)
To: Alemao; +Cc: linux-mtd
On Wed, 2009-11-25 at 10:03 -0200, Alemao wrote:
> Hi all,
>
> I have de following scenario:
>
> - Freescale MPC8541
> - U-Boot-2009.03
> - Linux-2.6.26
> - NAND flash 512Mbit (64MB), page: 512 bytes, erase block: 16KB
>
>
> And Im creating UBI image with this parameters:
>
> mkfs.ubifs -r rootfs/ -m 512 -c 3897 -e 15872 -o ubi.temp
> ubinize -o rootfs.ubifs -m 512 -p 16384 -s 256 ubinize.cfg
Please, start with validating your NAND flash/driver using the mtd
tests:
http://www.linux-mtd.infradead.org/doc/general.html#L_mtd_tests
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: UBIFS: problems writing to the partition
2009-11-26 7:32 ` Artem Bityutskiy
@ 2009-11-26 15:32 ` Alemao
2009-11-26 19:04 ` Alemao
0 siblings, 1 reply; 6+ messages in thread
From: Alemao @ 2009-11-26 15:32 UTC (permalink / raw)
To: linux-mtd
On Thu, Nov 26, 2009 at 5:32 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> On Wed, 2009-11-25 at 10:03 -0200, Alemao wrote:
>> Hi all,
>>
>> I have de following scenario:
>>
>> - Freescale MPC8541
>> - U-Boot-2009.03
>> - Linux-2.6.26
>> - NAND flash 512Mbit (64MB), page: 512 bytes, erase block: 16KB
>>
>>
>> And Im creating UBI image with this parameters:
>>
>> mkfs.ubifs -r rootfs/ -m 512 -c 3897 -e 15872 -o ubi.temp
>> ubinize -o rootfs.ubifs -m 512 -p 16384 -s 256 ubinize.cfg
>
> Please, start with validating your NAND flash/driver using the mtd
> tests:
> http://www.linux-mtd.infradead.org/doc/general.html#L_mtd_tests
Im using JFFS2 with no problem. My NAND driver is OK.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: UBIFS: problems writing to the partition
2009-11-26 15:32 ` Alemao
@ 2009-11-26 19:04 ` Alemao
0 siblings, 0 replies; 6+ messages in thread
From: Alemao @ 2009-11-26 19:04 UTC (permalink / raw)
To: linux-mtd
On Thu, Nov 26, 2009 at 1:32 PM, Alemao <xcarandiru@gmail.com> wrote:
> On Thu, Nov 26, 2009 at 5:32 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
>> On Wed, 2009-11-25 at 10:03 -0200, Alemao wrote:
>>> Hi all,
>>>
>>> I have de following scenario:
>>>
>>> - Freescale MPC8541
>>> - U-Boot-2009.03
>>> - Linux-2.6.26
>>> - NAND flash 512Mbit (64MB), page: 512 bytes, erase block: 16KB
>>>
>>>
>>> And Im creating UBI image with this parameters:
>>>
>>> mkfs.ubifs -r rootfs/ -m 512 -c 3897 -e 15872 -o ubi.temp
>>> ubinize -o rootfs.ubifs -m 512 -p 16384 -s 256 ubinize.cfg
>>
>> Please, start with validating your NAND flash/driver using the mtd
>> tests:
>> http://www.linux-mtd.infradead.org/doc/general.html#L_mtd_tests
>
>
> Im using JFFS2 with no problem. My NAND driver is OK.
>
I used mtd tests, here the results:
# insmod oobtest.ko dev=3
oobtest: oobtest finished with 0
# insmod pagetest.ko dev=3
pagetest: pagetest finished with 0 errors
# insmod scantest.ko dev=3
scantest: Size=67108864 EB size=16384 Write size=512 EB count=4096
Pages per EB=32 Page size=512 Oob size=16
scantest: scanning for bad blocks
scantest: found 0 bad
scantest: Testing page read
scantest: scantest finished
# insmod speedtest.ko dev=3
speedtest: Testing eraseblock write speed
eraseblock write speed is 2039 KiB/s
speedtest: Testing eraseblock read speed
eraseblock read speed is 3102 KiB/s
speedtest: Testing page write speed
page write speed is 2025 KiB/s
speedtest: Testing page read speed
page read speed is 3087 KiB/s
speedtest: Testing 2 page write speed
2 page write speed is 2033 KiB/s
speedtest: Testing 2 page read speed
2 page read speed is 3094 KiB/s
speedtest: Testing erase speed
erase speed is 9073 KiB/s
# insmod stresstest.ko dev=3 count=10000
stresstest: Doing operations
stresstest: 0 operations
stresstest: 4096 operations
stresstest: 8192 operations
stresstest: 10000 operations
stresstest: stresstest finished
# insmod subpagetest.ko dev=3
subpagetest: dev = 3
sub-page size is: 256
subpagetest: subpagetest finished with 0 errors
Seems there is no problem with my NAND driver. Im using Freescale
Local Bus UPM driver.
Any other hints or anything else should I check?
Cheers,
--
Alemao
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: UBIFS: problems writing to the partition
2009-11-25 12:03 UBIFS: problems writing to the partition Alemao
2009-11-26 7:32 ` Artem Bityutskiy
@ 2009-11-27 8:03 ` Adrian Hunter
2009-11-30 8:55 ` Artem Bityutskiy
2 siblings, 0 replies; 6+ messages in thread
From: Adrian Hunter @ 2009-11-27 8:03 UTC (permalink / raw)
To: Alemao; +Cc: linux-mtd@lists.infradead.org
Alemao wrote:
> Hi all,
>
> I have de following scenario:
>
> - Freescale MPC8541
> - U-Boot-2009.03
> - Linux-2.6.26
> - NAND flash 512Mbit (64MB), page: 512 bytes, erase block: 16KB
>
>
> And Im creating UBI image with this parameters:
>
> mkfs.ubifs -r rootfs/ -m 512 -c 3897 -e 15872 -o ubi.temp
> ubinize -o rootfs.ubifs -m 512 -p 16384 -s 256 ubinize.cfg
>
> My ubinize.cfg
>
> [ubifs]
> mode=ubi
> image=ubi.temp
> vol_id=0
> vol_size=60MiB
> vol_type=dynamic
> vol_name=ubipart
> vol_alignment=1
> vol_flags=autoresize
>
> Im loading the linux kernel from UBIFS partition in U-Boot and
> mounting again in kernel with no problem:
>
> # mount -t ubifs -o rw ubi0!ubipart /mnt/nand
> UBIFS: mounted UBI device 0, volume 0, name "ubipart"
> UBIFS: file system size: 61392896 bytes (59954 KiB, 58 MiB, 3868 LEBs)
> UBIFS: journal size: 8015360 bytes (7827 KiB, 7 MiB, 505 LEBs)
> UBIFS: media format: 4 (latest is 4)
> UBIFS: default compressor: lzo
> UBIFS: reserved for root: 0 bytes (0 KiB)
I guess if you turn on UBIFS debugging checks, it will not mount.
>
> # ls /mnt/nand/
> cfg www logs readme.txt
>
>
> But when I try to write something...
>
> # echo hi > /mnt/nand/hi.txt
> UBI error: paranoid_check_peb_vid_hdr: bad VID header CRC at PEB 0,
> calculated 0xb730eb2, read 0xffffffff
> UBI error: paranoid_check_peb_vid_hdr: paranoid check failed for PEB 0
> Call Trace:
> [df003c20] [c0006a4c] show_stack+0x50/0x170 (unreliable)
> [df003c50] [c01bad88] ubi_io_write+0x258/0x354
> [df003c90] [c01b8c34] ubi_eba_write_leb+0xd8/0x654
> [df003ce0] [c01b7568] ubi_leb_write+0x11c/0x140
> [df003d10] [c011fd28] dbg_leb_write+0xc0/0xe8
> [df003d40] [c00ff1ac] ubifs_wbuf_write_nolock+0x338/0x544
> [df003d70] [c00f2804] ubifs_jnl_write_data+0x23c/0x2c0
> [df003db0] [c00f5510] do_writepage+0xb8/0x1cc
> [df003df0] [c0049c3c] __writepage+0x24/0x68
> [df003e00] [c004ace0] write_cache_pages+0x1c0/0x334
> [df003e90] [c004aecc] do_writepages+0x50/0x78
> [df003ea0] [c0044248] __filemap_fdatawrite_range+0x7c/0x98
> [df003f00] [c0084520] do_fsync+0x3c/0xb0
> [df003f20] [c00845c0] __do_fsync+0x2c/0x50
> [df003f40] [c000d134] ret_from_syscall+0x0/0x3c
> UBI warning: ubi_eba_write_leb: failed to write data to PEB 0
> UBI warning: ubi_ro_mode: switch to read-only mode
> UBIFS error (pid 13868): ubifs_wbuf_write_nolock: cannot write 2289
> bytes to LEB 2896:0, error -22
>
> Dont know if Im creating the image with the right parameters.
>
> One thing that I notice is that when I DONT load the kernel from UBIFS
> in U-Boot, I can write to the partition in kernel with no problem. But
> after a reboot, I got some recovery messages:
Which means it was not un-mounted cleanly.
Gotta wonder if U-Boot is corrupting UBI / UBIFS?
>
> # mount -t ubifs -o rw ubi0!ubipart /mnt/nand
> UBIFS: recovery needed
> UBIFS: recovery completed
> UBIFS: mounted UBI device 0, volume 0, name "ubipart"
> UBIFS: file system size: 61392896 bytes (59954 KiB, 58 MiB, 3868 LEBs)
> UBIFS: journal size: 8015360 bytes (7827 KiB, 7 MiB, 505 LEBs)
> UBIFS: media format: 4 (latest is 4)
> UBIFS: default compressor: lzo
> UBIFS: reserved for root: 0 bytes (0 KiB)
>
>
> Here some messages from UBIFS kernel initialization:
>
> NAND device: Manufacturer ID: 0x20, Chip ID: 0x76 (ST Micro NAND 64MiB
> 3,3V 8-bit)
> Scanning device for bad blocks
> Creating 1 MTD partitions on "60000000.nand":
> 0x00000000-0x04000000 : "ubipart"
> UBI: attaching mtd3 to ubi0
> UBI: physical eraseblock size: 16384 bytes (16 KiB)
> UBI: logical eraseblock size: 15872 bytes
> UBI: smallest flash I/O unit: 512
> UBI: sub-page size: 256
> UBI: VID header offset: 256 (aligned 256)
> UBI: data offset: 512
> UBI: attached mtd3 to ubi0
> UBI: MTD device name: "ubipart"
> UBI: MTD device size: 64 MiB
> UBI: number of good PEBs: 4096
> UBI: number of bad PEBs: 0
> UBI: max. allowed volumes: 92
> UBI: wear-leveling threshold: 4096
> UBI: number of internal volumes: 1
> UBI: number of user volumes: 1
> UBI: available PEBs: 0
> UBI: total number of reserved PEBs: 4096
> UBI: number of PEBs reserved for bad PEB handling: 40
> UBI: max/mean erase counter: 2/0
>
>
> And my bootargs (U-Boot):
>
> root=/dev/ram rw console=ttyS0,115200 ubi.mtd=3
>
> or
>
> root=/dev/ram console=ttyS0,115200 ubi.mtd=3
>
>
> Any ideas about what could be happening?
>
> Thanks in advance,
>
> --
> Alemao
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: UBIFS: problems writing to the partition
2009-11-25 12:03 UBIFS: problems writing to the partition Alemao
2009-11-26 7:32 ` Artem Bityutskiy
2009-11-27 8:03 ` Adrian Hunter
@ 2009-11-30 8:55 ` Artem Bityutskiy
2 siblings, 0 replies; 6+ messages in thread
From: Artem Bityutskiy @ 2009-11-30 8:55 UTC (permalink / raw)
To: Alemao; +Cc: linux-mtd
On Wed, 2009-11-25 at 10:03 -0200, Alemao wrote:
> Hi all,
>
> I have de following scenario:
>
> - Freescale MPC8541
> - U-Boot-2009.03
> - Linux-2.6.26
> - NAND flash 512Mbit (64MB), page: 512 bytes, erase block: 16KB
>
>
> And Im creating UBI image with this parameters:
>
> mkfs.ubifs -r rootfs/ -m 512 -c 3897 -e 15872 -o ubi.temp
> ubinize -o rootfs.ubifs -m 512 -p 16384 -s 256 ubinize.cfg
How do you flash your UBI image then?
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-11-30 8:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-25 12:03 UBIFS: problems writing to the partition Alemao
2009-11-26 7:32 ` Artem Bityutskiy
2009-11-26 15:32 ` Alemao
2009-11-26 19:04 ` Alemao
2009-11-27 8:03 ` Adrian Hunter
2009-11-30 8:55 ` 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).