All of lore.kernel.org
 help / color / mirror / Atom feed
* ubiattach error!
@ 2010-03-23  9:26 jerry
  2010-04-08  8:23 ` Artem Bityutskiy
  0 siblings, 1 reply; 6+ messages in thread
From: jerry @ 2010-03-23  9:26 UTC (permalink / raw)
  To: linux-mtd

hi all,
I am trying to use ubi to attach mtd3(3.9G),but there are some
question.the mlc is SAMSUNG K9LBG080D,the kernel version is 2.6.28
# flash_erase  /dev/mtd3;

# ubiattach /dev/ubi_ctrl -m 3
UBI: attaching mtd3 to ubi0
UBI: physical eraseblock size:   524288 bytes (512 KiB)
UBI: logical eraseblock size:    516096 bytes
UBI: smallest flash I/O unit:    4096
UBI: VID header offset:          4096 (aligned 4096)
UBI: data offset:                8192
UBI: empty MTD device detected
UBI: create volume table (copy #1)
UBI: create volume table (copy #2)
UBI: attached mtd3 to ubi0
UBI: MTD device name:            "Filesys partition"
UBI: MTD device size:            4078 MiB
UBI: number of good PEBs:        8156
UBI: number of bad PEBs:         0
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     0
UBI: available PEBs:             8071
UBI: total number of reserved PEBs: 85
UBI: number of PEBs reserved for bad PEB handling: 81
UBI: max/mean erase counter: 0/0
UBI: background thread "ubi_bgt0d" started, PID 452
UBI device number 0, total 8156 LEBs (fae48000 bytes, 3.9 GiB),
available 8071 LEBs (f8472000 bytes, 3.9 GiB), LEB size 7e000 bytes
(504.0 KiB)

# ubimkvol /dev/ubi0 -n 0 -N uu -s 100MiB;
Volume ID 0, size 204 LEBs (105283584 bytes, 100.4 MiB), LEB size
516096 bytes (504.0 KiB), dynamic, name "uu", alignment 1

# ubidetach /dev/ubi_ctrl -m 3
UBI: mtd3 is detached from ubi0

# ubiattach /dev/ubi_ctrl -m 3
UBI: attaching mtd3 to ubi0
UBI: physical eraseblock size:   524288 bytes (512 KiB)
UBI: logical eraseblock size:    516096 bytes
UBI: smallest flash I/O unit:    4096
UBI: VID header offset:          4096 (aligned 4096)
UBI: data offset:                8192
UBI error: ubi_scan_add_used: two LEBs with same sequence number 4
ubiattach: error!: cannot attach mtd3
          error 22 (Invalid argument)

Thanks.

Best Regards,
Jerry

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

* Re: ubiattach error!
  2010-03-23  9:26 ubiattach error! jerry
@ 2010-04-08  8:23 ` Artem Bityutskiy
  2011-05-20 14:14   ` Timon ter Braak
  0 siblings, 1 reply; 6+ messages in thread
From: Artem Bityutskiy @ 2010-04-08  8:23 UTC (permalink / raw)
  To: jerry; +Cc: linux-mtd

On Tue, 2010-03-23 at 17:26 +0800, jerry wrote:
> hi all,
> I am trying to use ubi to attach mtd3(3.9G),but there are some
> question.the mlc is SAMSUNG K9LBG080D,the kernel version is 2.6.28
> # flash_erase  /dev/mtd3;
> 
> # ubiattach /dev/ubi_ctrl -m 3
> UBI: attaching mtd3 to ubi0
> UBI: physical eraseblock size:   524288 bytes (512 KiB)
> UBI: logical eraseblock size:    516096 bytes
> UBI: smallest flash I/O unit:    4096
> UBI: VID header offset:          4096 (aligned 4096)
> UBI: data offset:                8192
> UBI: empty MTD device detected
> UBI: create volume table (copy #1)
> UBI: create volume table (copy #2)
> UBI: attached mtd3 to ubi0
> UBI: MTD device name:            "Filesys partition"
> UBI: MTD device size:            4078 MiB
> UBI: number of good PEBs:        8156
> UBI: number of bad PEBs:         0
> UBI: max. allowed volumes:       128
> UBI: wear-leveling threshold:    4096
> UBI: number of internal volumes: 1
> UBI: number of user volumes:     0
> UBI: available PEBs:             8071
> UBI: total number of reserved PEBs: 85
> UBI: number of PEBs reserved for bad PEB handling: 81
> UBI: max/mean erase counter: 0/0
> UBI: background thread "ubi_bgt0d" started, PID 452
> UBI device number 0, total 8156 LEBs (fae48000 bytes, 3.9 GiB),
> available 8071 LEBs (f8472000 bytes, 3.9 GiB), LEB size 7e000 bytes
> (504.0 KiB)
> 
> # ubimkvol /dev/ubi0 -n 0 -N uu -s 100MiB;
> Volume ID 0, size 204 LEBs (105283584 bytes, 100.4 MiB), LEB size
> 516096 bytes (504.0 KiB), dynamic, name "uu", alignment 1
> 
> # ubidetach /dev/ubi_ctrl -m 3
> UBI: mtd3 is detached from ubi0
> 
> # ubiattach /dev/ubi_ctrl -m 3
> UBI: attaching mtd3 to ubi0
> UBI: physical eraseblock size:   524288 bytes (512 KiB)
> UBI: logical eraseblock size:    516096 bytes
> UBI: smallest flash I/O unit:    4096
> UBI: VID header offset:          4096 (aligned 4096)
> UBI: data offset:                8192
> UBI error: ubi_scan_add_used: two LEBs with same sequence number 4
> ubiattach: error!: cannot attach mtd3
>           error 22 (Invalid argument)

Looks weird, is this reproducible with nandsim?

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

* Re: ubiattach error!
  2010-04-08  8:23 ` Artem Bityutskiy
@ 2011-05-20 14:14   ` Timon ter Braak
  2011-05-20 14:23     ` Artem Bityutskiy
  0 siblings, 1 reply; 6+ messages in thread
From: Timon ter Braak @ 2011-05-20 14:14 UTC (permalink / raw)
  To: linux-mtd

Artem Bityutskiy <dedekind1 <at> gmail.com> writes:

> 
> > # ubiattach /dev/ubi_ctrl -m 3
> > UBI: attaching mtd3 to ubi0
> > UBI: physical eraseblock size:   524288 bytes (512 KiB)
> > UBI: logical eraseblock size:    516096 bytes
> > UBI: smallest flash I/O unit:    4096
> > UBI: VID header offset:          4096 (aligned 4096)
> > UBI: data offset:                8192
> > UBI error: ubi_scan_add_used: two LEBs with same sequence number 4
> > ubiattach: error!: cannot attach mtd3
> >           error 22 (Invalid argument)
> 
> Looks weird, is this reproducible with nandsim?
> 

After a power cut / reset, we experience similar problems.
I just upgraded to linux 2.6.39 as more and more UBIFS 'bugs' seem to get solved.
Unfortunately, we use a Spansion GL512P (64MB) NOR Flash chip,
which makes life kind of hard:

[    0.510000] UBI: attaching mtd1 to ubi0
[    0.510000] UBI: physical eraseblock size:   131072 bytes (128 KiB)
[    0.520000] UBI: logical eraseblock size:    130944 bytes
[    0.530000] UBI: smallest flash I/O unit:    1
[    0.530000] UBI: VID header offset:          64 (aligned 64)
[    0.540000] UBI: data offset:                128
[    0.540000] UBI error: ubi_scan_add_used: two LEBs with same sequence number 9
[    0.550000] UBI error: ubi_init: cannot attach mtd1

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

* Re: ubiattach error!
  2011-05-20 14:14   ` Timon ter Braak
@ 2011-05-20 14:23     ` Artem Bityutskiy
  2011-05-20 16:24       ` Timon ter Braak
  0 siblings, 1 reply; 6+ messages in thread
From: Artem Bityutskiy @ 2011-05-20 14:23 UTC (permalink / raw)
  To: Timon ter Braak; +Cc: linux-mtd

On Fri, 2011-05-20 at 14:14 +0000, Timon ter Braak wrote:
> Artem Bityutskiy <dedekind1 <at> gmail.com> writes:
> 
> > 
> > > # ubiattach /dev/ubi_ctrl -m 3
> > > UBI: attaching mtd3 to ubi0
> > > UBI: physical eraseblock size:   524288 bytes (512 KiB)
> > > UBI: logical eraseblock size:    516096 bytes
> > > UBI: smallest flash I/O unit:    4096
> > > UBI: VID header offset:          4096 (aligned 4096)
> > > UBI: data offset:                8192
> > > UBI error: ubi_scan_add_used: two LEBs with same sequence number 4
> > > ubiattach: error!: cannot attach mtd3
> > >           error 22 (Invalid argument)
> > 
> > Looks weird, is this reproducible with nandsim?
> > 
> 
> After a power cut / reset, we experience similar problems.
> I just upgraded to linux 2.6.39 as more and more UBIFS 'bugs' seem to get solved.
> Unfortunately, we use a Spansion GL512P (64MB) NOR Flash chip,
> which makes life kind of hard:
> 
> [    0.510000] UBI: attaching mtd1 to ubi0
> [    0.510000] UBI: physical eraseblock size:   131072 bytes (128 KiB)
> [    0.520000] UBI: logical eraseblock size:    130944 bytes
> [    0.530000] UBI: smallest flash I/O unit:    1
> [    0.530000] UBI: VID header offset:          64 (aligned 64)
> [    0.540000] UBI: data offset:                128
> [    0.540000] UBI error: ubi_scan_add_used: two LEBs with same sequence number 9
> [    0.550000] UBI error: ubi_init: cannot attach mtd1

Hmm. Can you confirm that:

1. you can attach the mtd device successfully.
2. detach it and attach again successfully.
3. Have a power cut, and then be unable attach it again because of this
   error?

Do you flash an UBI image? How do you do this?

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

* Re: ubiattach error!
  2011-05-20 14:23     ` Artem Bityutskiy
@ 2011-05-20 16:24       ` Timon ter Braak
  2011-05-23 12:42         ` Artem Bityutskiy
  0 siblings, 1 reply; 6+ messages in thread
From: Timon ter Braak @ 2011-05-20 16:24 UTC (permalink / raw)
  To: linux-mtd

Artem Bityutskiy <dedekind1 <at> gmail.com> writes:

> Hmm. Can you confirm that:
> 
> 1. you can attach the mtd device successfully.
> 2. detach it and attach again successfully.
> 3. Have a power cut, and then be unable attach it again because of this
>    error?
> 
> Do you flash an UBI image? How do you do this?

UBI itself is always able to attach to the mtd. The kernel is present on
the same chip and is never corrupted (of course it is never written to).
However, many times either the recovery of UBIFS fails, or we get some
errors after booting the kernel (probably spawned by 'ubi_bgt0d'?).

I will be happy to provide more information, but I am not sure what
exactly. It is difficult to separate what procedure corrupt the filesystem
and what does work. For example, even a normal 'reboot' command
results in the message 'recovery needed'; is that normal?

We flash a UBI image generated by the buildroot toolchain (we used
buildroot 2010.05 and 2011.02). We are able to work with the system
for an arbitrary amount of reboots and/or power cycles, but I can almost
destroy the filesystem on command.

I am working with a custom designed board for research purposes.
The board has been available for about a year right now. We started
with linux 2.6.33.4 and tried various patches and kernel upgrades,
to no avail. We think the main problem is that we use a Spansion
GL512P NOR flash, while most mechanisms within UBI(FS) assume a
certain state machine within the chip that may not hold at all times
for this one?

Best regards,
Timon ter Braak

Creating 3 MTD partitions on "physmap-flash.0":
0x000000000000-0x000000400000 : "linux"
0x000000400000-0x000002000000 : "rootfs"
0x000002000000-0x000004000000 : "rest"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    130944 bytes
UBI: smallest flash I/O unit:    1
UBI: VID header offset:          64 (aligned 64)
UBI: data offset:                128
UBI: max. sequence number:       76
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "rootfs"
UBI: MTD device size:            28 MiB
UBI: number of good PEBs:        224
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: 224
UBI: number of PEBs reserved for bad PEB handling: 0
UBI: max/mean erase counter: 2/1
UBI: image sequence number:  0
UBI: background thread "ubi_bgt0d" started, PID 21
macb macb: invalid hw address, using random
macb macb: eth0: Features changed: 0x00004800 -> 0x00004000
MACB_mii_bus: probed
eth0: Atmel MACB at 0xfffbc000 irq 22 (aa:4b:67:1f:7a:58)
eth0: attached PHY driver [Marvell 88E1111]
cpuidle: using governor ladder
cpuidle: using governor menu
TCP cubic registered
NET: Registered protocol family 17
Installing 9P2000 support
UBIFS: recovery needed
UBIFS: recovery completed
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size:   27498240 bytes (26853 KiB, 26 MiB, 210 LEBs)
UBIFS: journal size:       7725696 bytes (7544 KiB, 7 MiB, 59 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root:  0 bytes (0 KiB)

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

* Re: ubiattach error!
  2011-05-20 16:24       ` Timon ter Braak
@ 2011-05-23 12:42         ` Artem Bityutskiy
  0 siblings, 0 replies; 6+ messages in thread
From: Artem Bityutskiy @ 2011-05-23 12:42 UTC (permalink / raw)
  To: Timon ter Braak; +Cc: linux-mtd

On Fri, 2011-05-20 at 16:24 +0000, Timon ter Braak wrote:
> I will be happy to provide more information, but I am not sure what
> exactly. It is difficult to separate what procedure corrupt the filesystem
> and what does work. For example, even a normal 'reboot' command
> results in the message 'recovery needed'; is that normal?

Start with this:
http://www.linux-mtd.infradead.org/doc/ubifs.html#L_how_send_bugreport

If you cannot isolate the error - I cannot do it as well for sure. So
please, try to fine one specific thing which you think is a problem, and
ask to help with that specific thing. The above link should help. In
general, the first things you need to do are:

1. validate your mtd device with the test - this is always good thing to
do.
2. enable UBIFS debugging (not debugging messages)
3. report the issue properly as it is described at the MTD web site.

WRT. reboot: if your 'reboot' command results in 'recovery needed' then
your 'reboot' command does not unmount the file-system and just reboots
it. Of course from UBIFS's POW this is a power cut and it needs
recovery. But there is nothing to be afraid of if you know you synced
your files. So you need to take a look what "reboot" does - it may do
completely different things on different systems. E.g., does it sync the
data? does it unmount FSes?


-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

end of thread, other threads:[~2011-05-23 12:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-23  9:26 ubiattach error! jerry
2010-04-08  8:23 ` Artem Bityutskiy
2011-05-20 14:14   ` Timon ter Braak
2011-05-20 14:23     ` Artem Bityutskiy
2011-05-20 16:24       ` Timon ter Braak
2011-05-23 12:42         ` Artem Bityutskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.