public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* UBI FS on 2MiB eraseblock Hynix MLC NAND
@ 2011-08-04 13:59 Viktar Palstsiuk
  2011-08-15 16:01 ` Artem Bityutskiy
  0 siblings, 1 reply; 8+ messages in thread
From: Viktar Palstsiuk @ 2011-08-04 13:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Yauhen Kharuzhy

Hello,

While trying to use UBI FS on Hynix MLC NAND (2MiB eraseblock, 8k
pagesize) I faced with the problem that root mounts well only during
first boot after it was flashed.
On the second boot it reports that it failed to recover master node.
If some one has tested UBI FS on devices with large eraseblock?

Linux version 2.6.39.2 (vic@ws-024) (gcc version 4.4.1 (Sourcery G++
Lite 2009q3-68) ) #29 PREEMPT Thu Aug 4 16:19:24 EEST 2011
CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
CPU: VIVT data cache, VIVT instruction cache
Machine: Promwad WTPlug Reference Board
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096
Kernel command line: console=ttyS0,115200 init=/etc/preinit ubi.mtd=2
root=ubi0:rootfs rootfstype=ubifs
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 1024MB = 1024MB total
Memory: 1034012k/1034012k available, 14564k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xc0800000 - 0xfe800000   ( 992 MB)
    lowmem  : 0x80000000 - 0xc0000000   (1024 MB)
    modules : 0x7f000000 - 0x80000000   (  16 MB)
      .init : 0x80008000 - 0x80026000   ( 120 kB)
      .text : 0x80026000 - 0x804ab41c   (4630 kB)
      .data : 0x804ac000 - 0x804d9a80   ( 183 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Preemptable hierarchical RCU implementation.
        RCU-based detection of stalled CPUs is disabled.
        Verbose stalled-CPUs detection is disabled.
NR_IRQS:114
sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 21474ms
Console: colour dummy device 80x30
Calibrating delay loop... 990.41 BogoMIPS (lpj=4952064)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
Kirkwood: MV88F6282-Rev-Unsupported, TCLK=200000000.
Feroceon L2: Cache support initialised.
Kirkwood PCIe port 0:
link down, ignoring
bio: create slab <bio-0> at 0
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource orion_clocksource
Switched to NOHz mode on CPU #0
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
UDP hash table entries: 512 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 512 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 2019
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
console [ttyS0] enabled
loop: module loaded
NAND device: Manufacturer ID: 0xad, Chip ID: 0xd7 (Hynix NAND 4GiB 3,3V 8-bit)
Scanning device for bad blocks
Creating 4 MTD partitions on "orion_nand":
0x000000000000-0x000000400000 : "u-boot"
0x000000400000-0x000000800000 : "uImage"
0x000000800000-0x000019800000 : "rootfs"
0x000019800000-0x000100000000 : "auxfs"
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size:   2097152 bytes (2048 KiB)
UBI: logical eraseblock size:    2080768 bytes
UBI: smallest flash I/O unit:    8192
UBI: VID header offset:          8192 (aligned 8192)
UBI: data offset:                16384
UBI: max. sequence number:       10
UBI: attached mtd2 to ubi0
UBI: MTD device name:            "rootfs"
UBI: MTD device size:            400 MiB
UBI: number of good PEBs:        200
UBI: number of bad PEBs:         0
UBI: number of corrupted PEBs:   0
UBI: max. allowed volumes:       128
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: 200
UBI: number of PEBs reserved for bad PEB handling: 2
UBI: max/mean erase counter: 4/1
UBI: image sequence number:  934388287
UBI: background thread "ubi_bgt0d" started, PID 407
mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
mv643xx_eth smi: probed
mv643xx_eth_port mv643xx_eth_port.0: eth0: port 0 with MAC address
02:50:43:f0:26:2f
mv643xx_eth_port mv643xx_eth_port.1: eth1: port 0 with MAC address
02:50:43:0e:42:ed
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
orion-ehci orion-ehci.0: Marvell Orion EHCI
orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1
orion-ehci orion-ehci.0: irq 19, io mem 0xf1050000
orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver ums-datafab
usbcore: registered new interface driver ums-freecom
usbcore: registered new interface driver ums-jumpshot
usbcore: registered new interface driver ums-sddr09
usbcore: registered new interface driver ums-sddr55
mousedev: PS/2 mouse device common for all mice
rtc-mv rtc-mv: rtc core: registered rtc-mv as rtc0
i2c /dev entries driver
Software Watchdog Timer: 0.07 initialized. soft_noboot=0
soft_margin=60 sec soft_panic=0 (nowayout= 1)
cpuidle: using governor ladder
cpuidle: using governor menu
mv_xor_shared mv_xor_shared.0: Marvell shared XOR driver
mv_xor_shared mv_xor_shared.1: Marvell shared XOR driver
mv_xor mv_xor.0: Marvell XOR: ( xor cpy )
mv_xor mv_xor.1: Marvell XOR: ( xor fill cpy )
mv_xor mv_xor.2: Marvell XOR: ( xor cpy )
mv_xor mv_xor.3: Marvell XOR: ( xor fill cpy )
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP cubic registered
NET: Registered protocol family 17
lib80211: common routines for IEEE802.11 drivers
rtc-mv rtc-mv: setting system clock to 2000-02-26 02:34:28 UTC (951532468)
UBIFS error (pid 1): ubifs_recover_master_node: failed to recover master node
List of all partitions:
1f00            4096 mtdblock0  (driver?)
1f01            4096 mtdblock1  (driver?)
1f02          409600 mtdblock2  (driver?)
1f03         3776512 mtdblock3  (driver?)
No filesystem could mount root, tried:  ubifs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[<8002c2f0>] (unwind_backtrace+0x0/0x10c) from [<803b2410>] (panic+0x74/0x1a0)
[<803b2410>] (panic+0x74/0x1a0) from [<80008e08>] (mount_block_root+0x1e8/0x228)
[<80008e08>] (mount_block_root+0x1e8/0x228) from [<80008f98>]
(prepare_namespace+0x8c/0x17c)
[<80008f98>] (prepare_namespace+0x8c/0x17c) from [<80008470>]
(kernel_init+0x100/0x13c)
[<80008470>] (kernel_init+0x100/0x13c) from [<80027b64>]
(kernel_thread_exit+0x0/0x8)

Is this configuration is supported by linux 2.6.39.

Best regards,
Viktar Palstsiuk

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: UBI FS on 2MiB eraseblock Hynix MLC NAND
  2011-08-04 13:59 UBI FS on 2MiB eraseblock Hynix MLC NAND Viktar Palstsiuk
@ 2011-08-15 16:01 ` Artem Bityutskiy
  2011-08-16  7:48   ` Viktar Palstsiuk
  2011-08-16  8:13   ` Viktar Palstsiuk
  0 siblings, 2 replies; 8+ messages in thread
From: Artem Bityutskiy @ 2011-08-15 16:01 UTC (permalink / raw)
  To: Viktar Palstsiuk; +Cc: Yauhen Kharuzhy, linux-mtd

On Thu, 2011-08-04 at 16:59 +0300, Viktar Palstsiuk wrote:
> Hello,
> 
> While trying to use UBI FS on Hynix MLC NAND (2MiB eraseblock, 8k
> pagesize) I faced with the problem that root mounts well only during
> first boot after it was flashed.
> On the second boot it reports that it failed to recover master node.
> If some one has tested UBI FS on devices with large eraseblock?

Well, in theory it should work, but I've never heard about such huge
eraseblock so probably you are the first trying it, and probably there
is a bug.

> NET: Registered protocol family 17
> lib80211: common routines for IEEE802.11 drivers
> rtc-mv rtc-mv: setting system clock to 2000-02-26 02:34:28 UTC (951532468)
> UBIFS error (pid 1): ubifs_recover_master_node: failed to recover master node

Could you please enable UBIFS debugging, reproduce the issue and send me
all the kernel output - e.g., by typing dmesg or booting with the
ignore_loglevel kernel option?

-- 
Best Regards,
Artem Bityutskiy

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: UBI FS on 2MiB eraseblock Hynix MLC NAND
  2011-08-15 16:01 ` Artem Bityutskiy
@ 2011-08-16  7:48   ` Viktar Palstsiuk
  2011-08-16  8:08     ` Artem Bityutskiy
  2011-08-16  8:13   ` Viktar Palstsiuk
  1 sibling, 1 reply; 8+ messages in thread
From: Viktar Palstsiuk @ 2011-08-16  7:48 UTC (permalink / raw)
  To: Artem Bityutskiy; +Cc: Yauhen Kharuzhy, linux-mtd

The problem was caused by behavior of H27UBG8T2ATR Hynix MLC NAND
while UBI FS was trying to do page write operation. UBI FS was trying
to write data to the first empty page assuming that 0xFF page is
erased and writable. But this type of NAND returns error on page write
operation even if it was entirely written with 0xFF before. As far as
I'm using U-boot's 'nand write' to flash UBI image I've added skip if
U-boot trying to write 0xFF-page.

--- drivers/mtd/nand/nand_base.c
+++ drivers/mtd/nand/nand_base.c	(working copy)
@@ -1761,7 +1761,18 @@
 			   const uint8_t *buf, int page, int cached, int raw)
 {
 	int status;
+	int i;

+	/* Skip empty page */
+	for (i = 0; i < mtd->writesize; i++)
+                if (buf[i] != 0xFF)
+                        break;
+	
+	if (i == mtd->writesize) {
+		printf ("nand_write_page: Skip 0xFF page\n");
+		return 0;
+	}
+	
 	chip->cmdfunc(mtd, NAND_CMD_SEQIN, 0x00, page);

 	if (unlikely(raw))

So it works fine now.

I also had to increase PEB size limit in mtd-utils to create UBI image.

diff --git a/mkfs.ubifs/mkfs.ubifs.c b/mkfs.ubifs/mkfs.ubifs.c
index dcdb722..307edff 100644
--- a/mkfs.ubifs/mkfs.ubifs.c
+++ b/mkfs.ubifs/mkfs.ubifs.c
@@ -390,7 +390,7 @@ static int validate_options(void)
 		return err_msg("LEB should be multiple of min. I/O units");
 	if (c->leb_size % 8)
 		return err_msg("LEB size has to be multiple of 8");
-	if (c->leb_size > 1024*1024)
+	if (c->leb_size > 2*1024*1024)
 		return err_msg("too large LEB size %d", c->leb_size);
 	if (c->max_leb_cnt < UBIFS_MIN_LEB_CNT)
 		return err_msg("too low max. count of LEBs, minimum is %d",
diff --git a/ubi-utils/ubinize.c b/ubi-utils/ubinize.c
index 453494d..a71d067 100644
--- a/ubi-utils/ubinize.c
+++ b/ubi-utils/ubinize.c
@@ -253,7 +253,7 @@ static int parse_opt(int argc, char * const argv[])
 	if (args.peb_size < 0)
 		return errmsg("physical eraseblock size was not specified (use -h
for help)");

-	if (args.peb_size > 1024*1024)
+	if (args.peb_size > 2*1024*1024)
 		return errmsg("too high physical eraseblock size %d", args.peb_size);

 	if (args.min_io_size < 0)

Best regards,
Viktar Palstsiuk

On Mon, Aug 15, 2011 at 7:01 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> On Thu, 2011-08-04 at 16:59 +0300, Viktar Palstsiuk wrote:
>> Hello,
>>
>> While trying to use UBI FS on Hynix MLC NAND (2MiB eraseblock, 8k
>> pagesize) I faced with the problem that root mounts well only during
>> first boot after it was flashed.
>> On the second boot it reports that it failed to recover master node.
>> If some one has tested UBI FS on devices with large eraseblock?
>
> Well, in theory it should work, but I've never heard about such huge
> eraseblock so probably you are the first trying it, and probably there
> is a bug.
>
>> NET: Registered protocol family 17
>> lib80211: common routines for IEEE802.11 drivers
>> rtc-mv rtc-mv: setting system clock to 2000-02-26 02:34:28 UTC (951532468)
>> UBIFS error (pid 1): ubifs_recover_master_node: failed to recover master node
>
> Could you please enable UBIFS debugging, reproduce the issue and send me
> all the kernel output - e.g., by typing dmesg or booting with the
> ignore_loglevel kernel option?
>
> --
> Best Regards,
> Artem Bityutskiy
>
>

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: UBI FS on 2MiB eraseblock Hynix MLC NAND
  2011-08-16  7:48   ` Viktar Palstsiuk
@ 2011-08-16  8:08     ` Artem Bityutskiy
  2011-08-16  8:30       ` Yauhen Kharuzhy
                         ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Artem Bityutskiy @ 2011-08-16  8:08 UTC (permalink / raw)
  To: Viktar Palstsiuk; +Cc: Ben Gardiner, Yauhen Kharuzhy, linux-mtd

Hi,

On Tue, 2011-08-16 at 10:48 +0300, Viktar Palstsiuk wrote:
> The problem was caused by behavior of H27UBG8T2ATR Hynix MLC NAND
> while UBI FS was trying to do page write operation. UBI FS was trying
> to write data to the first empty page assuming that 0xFF page is
> erased and writable. But this type of NAND returns error on page write
> operation even if it was entirely written with 0xFF before. As far as
> I'm using U-boot's 'nand write' to flash UBI image I've added skip if
> U-boot trying to write 0xFF-page.
> 
> --- drivers/mtd/nand/nand_base.c
> +++ drivers/mtd/nand/nand_base.c	(working copy)
> @@ -1761,7 +1761,18 @@
>  			   const uint8_t *buf, int page, int cached, int raw)
>  {
>  	int status;
> +	int i;
> 
> +	/* Skip empty page */
> +	for (i = 0; i < mtd->writesize; i++)
> +                if (buf[i] != 0xFF)
> +                        break;
> +	
> +	if (i == mtd->writesize) {
> +		printf ("nand_write_page: Skip 0xFF page\n");
> +		return 0;
> +	}
> +	

This solution is not acceptable as we are currently discussing in the
"GPMI-NAND Status" thread in this mailing list.

Instead, you should just change u-boot, and I believe someone has done
this recently - ask the u-boot mailing list. I think that was Ben -
CCed.

The alternative is to use the new UBIFS "fixup" feature, see
http://www.linux-mtd.infradead.org/faq/ubifs.html#L_free_space_fixup

Additionally, here is my old writing about how the UBI flasher should
work, just FYI:
http://www.linux-mtd.infradead.org/doc/ubi.html#L_flasher_algo

> So it works fine now.

No, with this change if my data happens to be all 0xFFs - it will be unprotected
against bit flips.

BTW, I asumme you read this:

http://www.linux-mtd.infradead.org/faq/ubifs.html#L_ubifs_mlc

> diff --git a/mkfs.ubifs/mkfs.ubifs.c b/mkfs.ubifs/mkfs.ubifs.c
> index dcdb722..307edff 100644
> --- a/mkfs.ubifs/mkfs.ubifs.c
> +++ b/mkfs.ubifs/mkfs.ubifs.c
> @@ -390,7 +390,7 @@ static int validate_options(void)
>  		return err_msg("LEB should be multiple of min. I/O units");
>  	if (c->leb_size % 8)
>  		return err_msg("LEB size has to be multiple of 8");
> -	if (c->leb_size > 1024*1024)
> +	if (c->leb_size > 2*1024*1024)
>  		return err_msg("too large LEB size %d", c->leb_size);
>  	if (c->max_leb_cnt < UBIFS_MIN_LEB_CNT)
>  		return err_msg("too low max. count of LEBs, minimum is %d",
> diff --git a/ubi-utils/ubinize.c b/ubi-utils/ubinize.c
> index 453494d..a71d067 100644
> --- a/ubi-utils/ubinize.c
> +++ b/ubi-utils/ubinize.c
> @@ -253,7 +253,7 @@ static int parse_opt(int argc, char * const argv[])
>  	if (args.peb_size < 0)
>  		return errmsg("physical eraseblock size was not specified (use -h
> for help)");
> 
> -	if (args.peb_size > 1024*1024)
> +	if (args.peb_size > 2*1024*1024)
>  		return errmsg("too high physical eraseblock size %d", args.peb_size);
> 
>  	if (args.min_io_size < 0)

Please, introduce a nice macro like MAX_PEB_SIZE and use it instead

-- 
Best Regards,
Artem Bityutskiy

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: UBI FS on 2MiB eraseblock Hynix MLC NAND
  2011-08-15 16:01 ` Artem Bityutskiy
  2011-08-16  7:48   ` Viktar Palstsiuk
@ 2011-08-16  8:13   ` Viktar Palstsiuk
  1 sibling, 0 replies; 8+ messages in thread
From: Viktar Palstsiuk @ 2011-08-16  8:13 UTC (permalink / raw)
  To: Artem Bityutskiy; +Cc: Yauhen Kharuzhy, linux-mtd

Here are logs:

First boot:

U-Boot 2011.06-svn936 (Aug 03 2011 - 18:31:46)
Promwad-WTPlug

SoC:   Kirkwood 88F6282_?? RevID 0x01
DRAM:  1 GiB
NAND:  2048 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0, egiga1
88E1121 Initialized on egiga0, devadr 0
88E1121 Initialized on egiga1, devadr 1
Hit any key to stop autoboot:  0

NAND read: device 0 offset 0x400000, size 0x400000
 4194304 bytes read: OK
## Booting kernel from Legacy Image at 06400000 ...
   Image Name:   Linux-2.6.39.2-svn928
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2664652 Bytes = 2.5 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.39.2-svn928 (vic@ws-024) (gcc version 4.4.1
(Sourcery G++ Lite 2009q3-68) ) #14 PREEMPT Thu Aug 4 09:14:55 EEST
2011
CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
CPU: VIVT data cache, VIVT instruction cache
Machine: Promwad WTPlug Reference Board
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096
Kernel command line: console=ttyS0,115200 init=/etc/preinit ubi.mtd=2
root=ubi0:rootfs rootfstype=ubifs
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 1024MB = 1024MB total
Memory: 1034028k/1034028k available, 14548k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xc0800000 - 0xfe800000   ( 992 MB)
    lowmem  : 0x80000000 - 0xc0000000   (1024 MB)
    modules : 0x7f000000 - 0x80000000   (  16 MB)
      .init : 0x80008000 - 0x80026000   ( 120 kB)
      .text : 0x80026000 - 0x804a739c   (4613 kB)
      .data : 0x804a8000 - 0x804d5a80   ( 183 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Preemptable hierarchical RCU implementation.
        RCU-based detection of stalled CPUs is disabled.
        Verbose stalled-CPUs detection is disabled.
NR_IRQS:114
sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 21474ms
Console: colour dummy device 80x30
Calibrating delay loop... 990.41 BogoMIPS (lpj=4952064)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
Kirkwood: MV88F6282-Rev-Unsupported, TCLK=200000000.
Feroceon L2: Cache support initialised.
Kirkwood PCIe port 0:
link down, ignoring
bio: create slab <bio-0> at 0
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource orion_clocksource
Switched to NOHz mode on CPU #0
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
UDP hash table entries: 512 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 512 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
JFFS2 version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
msgmni has been set to 2019
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
console [ttyS0] enabled
loop: module loaded
NAND device: Manufacturer ID: 0xad, Chip ID: 0xd7 (Hynix NAND 4GiB 3,3V 8-bit)
Scanning device for bad blocks
Creating 4 MTD partitions on "orion_nand":
0x000000000000-0x000000400000 : "u-boot"
mtd: Giving out device 0 to u-boot
0x000000400000-0x000000800000 : "uImage"
mtd: Giving out device 1 to uImage
0x000000800000-0x000019800000 : "rootfs"
mtd: Giving out device 2 to rootfs
0x000019800000-0x000100000000 : "auxfs"
mtd: Giving out device 3 to auxfs
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size:   2097152 bytes (2048 KiB)
UBI: logical eraseblock size:    2080768 bytes
UBI: smallest flash I/O unit:    8192
UBI: VID header offset:          8192 (aligned 8192)
UBI: data offset:                16384
UBI: max. sequence number:       0
UBI: volume 0 ("rootfs") re-sized from 147 to 194 LEBs
UBI: attached mtd2 to ubi0
UBI: MTD device name:            "rootfs"
UBI: MTD device size:            400 MiB
UBI: number of good PEBs:        200
UBI: number of bad PEBs:         0
UBI: number of corrupted PEBs:   0
UBI: max. allowed volumes:       128
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: 200
UBI: number of PEBs reserved for bad PEB handling: 2
UBI: max/mean erase counter: 1/0
UBI: image sequence number:  620376764
UBI: background thread "ubi_bgt0d" started, PID 407
mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
mv643xx_eth smi: probed
mv643xx_eth_port mv643xx_eth_port.0: eth0: port 0 with MAC address
02:50:43:f0:26:2f
mv643xx_eth_port mv643xx_eth_port.1: eth1: port 0 with MAC address
02:50:43:0e:42:ed
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
orion-ehci orion-ehci.0: Marvell Orion EHCI
orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1
orion-ehci orion-ehci.0: irq 19, io mem 0xf1050000
orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver ums-datafab
usbcore: registered new interface driver ums-freecom
usbcore: registered new interface driver ums-jumpshot
usbcore: registered new interface driver ums-sddr09
usbcore: registered new interface driver ums-sddr55
mousedev: PS/2 mouse device common for all mice
rtc-mv rtc-mv: rtc core: registered rtc-mv as rtc0
i2c /dev entries driver
Software Watchdog Timer: 0.07 initialized. soft_noboot=0
soft_margin=60 sec soft_panic=0 (nowayout= 1)
cpuidle: using governor ladder
cpuidle: using governor menu
mv_xor_shared mv_xor_shared.0: Marvell shared XOR driver
mv_xor_shared mv_xor_shared.1: Marvell shared XOR driver
mv_xor mv_xor.0: Marvell XOR: ( xor cpy )
mv_xor mv_xor.1: Marvell XOR: ( xor fill cpy )
mv_xor mv_xor.2: Marvell XOR: ( xor cpy )
mv_xor mv_xor.3: Marvell XOR: ( xor fill cpy )
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP cubic registered
NET: Registered protocol family 17
lib80211: common routines for IEEE802.11 drivers
rtc-mv rtc-mv: setting system clock to 2000-02-26 02:35:26 UTC (951532526)
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size:   382861312 bytes (373888 KiB, 365 MiB, 184 LEBs)
UBIFS: journal size:       18726913 bytes (18288 KiB, 17 MiB, 9 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: zlib
UBIFS: reserved for root:  0 bytes (0 KiB)
VFS: Mounted root (ubifs filesystem) on device 0:13.
Freeing init memory: 120K
- preinit -
Press the [f] key and hit [enter] to enter failsafe mode
- regular preinit -
UBI error: ubi_io_write: error -5 while writing 8192 bytes to PEB
3:32768, written 0 bytes
UBI warning: ubi_eba_write_leb: failed to write data to PEB 3
UBI: recover PEB 3, move data to PEB 80
UBI: run torture test for PEB 3
UBI: data was successfully recovered
UBI error: ubi_io_write: error -5 while writing 8192 bytes to PEB
4:32768, written 0 bytes
UBI warning: ubi_eba_write_leb: failed to write data to PEB 4
UBI: recover PEB 4, move data to PEB 81
UBI: PEB 3 passed torture test, do not mark it a bad
UBI: data was successfully recovered
UBI: run torture test for PEB 4
MTD_open
MTD_ioctl
MTD_ioctl
MTD_close
- init -

Please press Enter to activate this console.

BusyBox v1.18.5 (2011-07-28 14:33:34 EEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 ATTITUDE ADJUSTMENT (bleeding edge, r951) ----------
  * 1/4 oz Vodka      Pour all ingredients into mixing
  * 1/4 oz Gin        tin with ice, strain into glass.
  * 1/4 oz Amaretto
  * 1/4 oz Triple sec
  * 1/4 oz Peach schnapps
  * 1/4 oz Sour mix
  * 1 splash Cranberry juice
 -----------------------------------------------------
root@OpenWrt:/# UBI: PEB 4 passed torture test, do not mark it a bad
mv643xx_eth_port mv643xx_eth_port.0: eth0: link up, 1000 Mb/s, full
duplex, flow control disabled
UBI error: ubi_io_write: error -5 while writing 8192 bytes to PEB
12:1277952, written 0 bytes
UBI warning: ubi_eba_write_leb: failed to write data to PEB 12
UBI: recover PEB 12, move data to PEB 82
UBI: run torture test for PEB 12
UBI: data was successfully recovered
UBI: PEB 12 passed torture test, do not mark it a bad

Second boot:

U-Boot 2011.06-svn936 (Aug 03 2011 - 18:31:46)
Promwad-WTPlug

SoC:   Kirkwood 88F6282_?? RevID 0x01
DRAM:  1 GiB
NAND:  2048 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0, egiga1
88E1121 Initialized on egiga0, devadr 0
88E1121 Initialized on egiga1, devadr 1
Hit any key to stop autoboot:  0

NAND read: device 0 offset 0x400000, size 0x400000
 4194304 bytes read: OK
## Booting kernel from Legacy Image at 06400000 ...
   Image Name:   Linux-2.6.39.2-svn928
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2675704 Bytes = 2.6 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.39.2-svn928 (vic@ws-024) (gcc version 4.4.1
(Sourcery G++ Lite 2009q3-68) ) #29 PREEMPT Thu Aug 4 16:19:24 EEST
2011
CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
CPU: VIVT data cache, VIVT instruction cache
Machine: Promwad WTPlug Reference Board
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096
Kernel command line: console=ttyS0,115200 init=/etc/preinit ubi.mtd=2
root=ubi0:rootfs rootfstype=ubifs
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 1024MB = 1024MB total
Memory: 1034012k/1034012k available, 14564k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xc0800000 - 0xfe800000   ( 992 MB)
    lowmem  : 0x80000000 - 0xc0000000   (1024 MB)
    modules : 0x7f000000 - 0x80000000   (  16 MB)
      .init : 0x80008000 - 0x80026000   ( 120 kB)
      .text : 0x80026000 - 0x804ab41c   (4630 kB)
      .data : 0x804ac000 - 0x804d9a80   ( 183 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Preemptable hierarchical RCU implementation.
        RCU-based detection of stalled CPUs is disabled.
        Verbose stalled-CPUs detection is disabled.
NR_IRQS:114
sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 21474ms
Console: colour dummy device 80x30
Calibrating delay loop... 990.41 BogoMIPS (lpj=4952064)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
Kirkwood: MV88F6282-Rev-Unsupported, TCLK=200000000.
Feroceon L2: Cache support initialised.
Kirkwood PCIe port 0:
link down, ignoring
bio: create slab <bio-0> at 0
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource orion_clocksource
Switched to NOHz mode on CPU #0
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
UDP hash table entries: 512 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 512 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 2019
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
console [ttyS0] enabled
loop: module loaded
NAND device: Manufacturer ID: 0xad, Chip ID: 0xd7 (Hynix NAND 4GiB 3,3V 8-bit)
Scanning device for bad blocks
Creating 4 MTD partitions on "orion_nand":
0x000000000000-0x000000400000 : "u-boot"
0x000000400000-0x000000800000 : "uImage"
0x000000800000-0x000019800000 : "rootfs"
0x000019800000-0x000100000000 : "auxfs"
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size:   2097152 bytes (2048 KiB)
UBI: logical eraseblock size:    2080768 bytes
UBI: smallest flash I/O unit:    8192
UBI: VID header offset:          8192 (aligned 8192)
UBI: data offset:                16384
UBI: max. sequence number:       10
UBI: attached mtd2 to ubi0
UBI: MTD device name:            "rootfs"
UBI: MTD device size:            400 MiB
UBI: number of good PEBs:        200
UBI: number of bad PEBs:         0
UBI: number of corrupted PEBs:   0
UBI: max. allowed volumes:       128
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: 200
UBI: number of PEBs reserved for bad PEB handling: 2
UBI: max/mean erase counter: 4/1
UBI: image sequence number:  934388287
UBI: background thread "ubi_bgt0d" started, PID 407
mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
mv643xx_eth smi: probed
mv643xx_eth_port mv643xx_eth_port.0: eth0: port 0 with MAC address
02:50:43:f0:26:2f
mv643xx_eth_port mv643xx_eth_port.1: eth1: port 0 with MAC address
02:50:43:0e:42:ed
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
orion-ehci orion-ehci.0: Marvell Orion EHCI
orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1
orion-ehci orion-ehci.0: irq 19, io mem 0xf1050000
orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver ums-datafab
usbcore: registered new interface driver ums-freecom
usbcore: registered new interface driver ums-jumpshot
usbcore: registered new interface driver ums-sddr09
usbcore: registered new interface driver ums-sddr55
mousedev: PS/2 mouse device common for all mice
rtc-mv rtc-mv: rtc core: registered rtc-mv as rtc0
i2c /dev entries driver
Software Watchdog Timer: 0.07 initialized. soft_noboot=0
soft_margin=60 sec soft_panic=0 (nowayout= 1)
cpuidle: using governor ladder
cpuidle: using governor menu
mv_xor_shared mv_xor_shared.0: Marvell shared XOR driver
mv_xor_shared mv_xor_shared.1: Marvell shared XOR driver
mv_xor mv_xor.0: Marvell XOR: ( xor cpy )
mv_xor mv_xor.1: Marvell XOR: ( xor fill cpy )
mv_xor mv_xor.2: Marvell XOR: ( xor cpy )
mv_xor mv_xor.3: Marvell XOR: ( xor fill cpy )
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP cubic registered
NET: Registered protocol family 17
lib80211: common routines for IEEE802.11 drivers
rtc-mv rtc-mv: setting system clock to 2000-02-26 02:34:28 UTC (951532468)
UBIFS error (pid 1): ubifs_recover_master_node: failed to recover master node
List of all partitions:
1f00            4096 mtdblock0  (driver?)
1f01            4096 mtdblock1  (driver?)
1f02          409600 mtdblock2  (driver?)
1f03         3776512 mtdblock3  (driver?)
No filesystem could mount root, tried:  ubifs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[<8002c2f0>] (unwind_backtrace+0x0/0x10c) from [<803b2410>] (panic+0x74/0x1a0)
[<803b2410>] (panic+0x74/0x1a0) from [<80008e08>] (mount_block_root+0x1e8/0x228)
[<80008e08>] (mount_block_root+0x1e8/0x228) from [<80008f98>]
(prepare_namespace+0x8c/0x17c)
[<80008f98>] (prepare_namespace+0x8c/0x17c) from [<80008470>]
(kernel_init+0x100/0x13c)
[<80008470>] (kernel_init+0x100/0x13c) from [<80027b64>]
(kernel_thread_exit+0x0/0x8)

Best regards,
Viktar Palstsiuk

On Mon, Aug 15, 2011 at 7:01 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> On Thu, 2011-08-04 at 16:59 +0300, Viktar Palstsiuk wrote:
>> Hello,
>>
>> While trying to use UBI FS on Hynix MLC NAND (2MiB eraseblock, 8k
>> pagesize) I faced with the problem that root mounts well only during
>> first boot after it was flashed.
>> On the second boot it reports that it failed to recover master node.
>> If some one has tested UBI FS on devices with large eraseblock?
>
> Well, in theory it should work, but I've never heard about such huge
> eraseblock so probably you are the first trying it, and probably there
> is a bug.
>
>> NET: Registered protocol family 17
>> lib80211: common routines for IEEE802.11 drivers
>> rtc-mv rtc-mv: setting system clock to 2000-02-26 02:34:28 UTC (951532468)
>> UBIFS error (pid 1): ubifs_recover_master_node: failed to recover master node
>
> Could you please enable UBIFS debugging, reproduce the issue and send me
> all the kernel output - e.g., by typing dmesg or booting with the
> ignore_loglevel kernel option?
>
> --
> Best Regards,
> Artem Bityutskiy
>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: UBI FS on 2MiB eraseblock Hynix MLC NAND
  2011-08-16  8:08     ` Artem Bityutskiy
@ 2011-08-16  8:30       ` Yauhen Kharuzhy
  2011-08-16  8:49       ` Viktar Palstsiuk
  2011-08-22 13:10       ` Ben Gardiner
  2 siblings, 0 replies; 8+ messages in thread
From: Yauhen Kharuzhy @ 2011-08-16  8:30 UTC (permalink / raw)
  To: Artem Bityutskiy; +Cc: Viktar Palstsiuk, Ben Gardiner, linux-mtd

On Tue, Aug 16, 2011 at 11:08:20AM +0300, Artem Bityutskiy wrote:
> Hi,
> 
> On Tue, 2011-08-16 at 10:48 +0300, Viktar Palstsiuk wrote:
> > The problem was caused by behavior of H27UBG8T2ATR Hynix MLC NAND
> > while UBI FS was trying to do page write operation. UBI FS was trying
> > to write data to the first empty page assuming that 0xFF page is
> > erased and writable. But this type of NAND returns error on page write
> > operation even if it was entirely written with 0xFF before. As far as
> > I'm using U-boot's 'nand write' to flash UBI image I've added skip if
> > U-boot trying to write 0xFF-page.
> > 
> > --- drivers/mtd/nand/nand_base.c
> > +++ drivers/mtd/nand/nand_base.c	(working copy)
> > @@ -1761,7 +1761,18 @@
> >  			   const uint8_t *buf, int page, int cached, int raw)
> >  {
> >  	int status;
> > +	int i;
> > 
> > +	/* Skip empty page */
> > +	for (i = 0; i < mtd->writesize; i++)
> > +                if (buf[i] != 0xFF)
> > +                        break;
> > +	
> > +	if (i == mtd->writesize) {
> > +		printf ("nand_write_page: Skip 0xFF page\n");
> > +		return 0;
> > +	}
> > +	
> 
> This solution is not acceptable as we are currently discussing in the
> "GPMI-NAND Status" thread in this mailing list.
> 
> Instead, you should just change u-boot, and I believe someone has done
> this recently - ask the u-boot mailing list. I think that was Ben -
> CCed.

As I understood, above Victor's patch is for U-Boot, not for kernel.


-- 
Yauhen Kharuzhy
-----------------------------------------------------------
Promwad Innovation Company
22, Olshevskogo St.
Office 809
220073, Minsk, Belarus
Phone/Fax: +375 (17) 312-1246
E-mail: yauhen.kharuzhy@promwad.com
Skype: jekhor
Web: www.promwad.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: UBI FS on 2MiB eraseblock Hynix MLC NAND
  2011-08-16  8:08     ` Artem Bityutskiy
  2011-08-16  8:30       ` Yauhen Kharuzhy
@ 2011-08-16  8:49       ` Viktar Palstsiuk
  2011-08-22 13:10       ` Ben Gardiner
  2 siblings, 0 replies; 8+ messages in thread
From: Viktar Palstsiuk @ 2011-08-16  8:49 UTC (permalink / raw)
  To: Artem Bityutskiy; +Cc: Yauhen Kharuzhy, linux-mtd

On Tue, Aug 16, 2011 at 11:08 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> The alternative is to use the new UBIFS "fixup" feature, see
> http://www.linux-mtd.infradead.org/faq/ubifs.html#L_free_space_fixup

Does UBIFS fixup works on 2.6.39.2 or should I switch to kernel version 3.0?

Best regards,
Viktar Palstsiuk

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: UBI FS on 2MiB eraseblock Hynix MLC NAND
  2011-08-16  8:08     ` Artem Bityutskiy
  2011-08-16  8:30       ` Yauhen Kharuzhy
  2011-08-16  8:49       ` Viktar Palstsiuk
@ 2011-08-22 13:10       ` Ben Gardiner
  2 siblings, 0 replies; 8+ messages in thread
From: Ben Gardiner @ 2011-08-22 13:10 UTC (permalink / raw)
  To: Viktar Palstsiuk, dedekind1; +Cc: Yauhen Kharuzhy, linux-mtd

Hi Viktar, Artem,

On Tue, Aug 16, 2011 at 4:08 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> On Tue, 2011-08-16 at 10:48 +0300, Viktar Palstsiuk wrote:
>> [...]
> This solution is not acceptable as we are currently discussing in the
> "GPMI-NAND Status" thread in this mailing list.
>
> Instead, you should just change u-boot, and I believe someone has done
> this recently - ask the u-boot mailing list. I think that was Ben -
> CCed.

Yep. That was me (with some critical help from others of course).

The problem to which you (Viktar) are refferring is certainly not
limited to hynix, 2mib or mlc. I agree with Artem's assessment: use
the new 'nand write.trimffs'  command in u-boot or use the fixup flag
in your ubi images.

Best Regards,
Ben Gardiner

---
Nanometrics Inc.
http://www.nanometrics.ca

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-08-22 13:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-04 13:59 UBI FS on 2MiB eraseblock Hynix MLC NAND Viktar Palstsiuk
2011-08-15 16:01 ` Artem Bityutskiy
2011-08-16  7:48   ` Viktar Palstsiuk
2011-08-16  8:08     ` Artem Bityutskiy
2011-08-16  8:30       ` Yauhen Kharuzhy
2011-08-16  8:49       ` Viktar Palstsiuk
2011-08-22 13:10       ` Ben Gardiner
2011-08-16  8:13   ` Viktar Palstsiuk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox