UBIFS ubimkvol issue and some others...
Hi all,
I am trying to use UbiFS but having some issues.
I read the documentations and FAQs for UBI and UbiFS.
My kernel is pretty old (2.6.21) (I am not able to update it now)
but I successfully added UbiFS in it!
First I erased my NAND device with flash_eraseall (flash_eraseall /dev/mtd5).
I added attaching the MTD device with kernel parameter ubi.mtd=5 (My NAND device is /dev/mtd5). and it is successfully attached.
Kernel Log:
------------------------------------------------------
UBI: empty MTD device detected
UBI: create volume table (copy #1)
UBI: create volume table (copy #2)
UBI: attached mtd5 to ubi1
UBI: MTD device name: "nand_data"
UBI: MTD device size: 64 MiB
UBI: physical eraseblock size: 16384 bytes (16 KiB)
UBI: logical eraseblock size: 15872 bytes
UBI: number of good PEBs: 4096
UBI: number of bad PEBs: 0
UBI: smallest flash I/O unit: 512
UBI: VID header offset: 256 (aligned 256)
UBI: data offset: 512
UBI: max. allowed volumes: 92
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 0
UBI: available PEBs: 4053
UBI: total number of reserved PEBs: 43
UBI: number of PEBs reserved for bad PEB handling: 40
UBI: max/mean erase counter: 0/0
------------------------------------------------------
Created /dev/ubi0 device by hand:
# cat /sys/class/ubi/ubi0/dev 254:0 # mknod /dev/ubi0 c 254 0
I have problems with some of the coomands:
------------------------------------------------------
# /mtdinfo
Count of MTD devices: 6
Present MTD devices:
mtdinfo: error!: libmtd failed get MTD device 0 information
error 2 (No such file or directory)
------------------------------------------------------
The following is one of the main issues:
# /ubiformat /dev//mtd5
ubiformat: error!: cannot get information about "/dev//mtd5"
error 2 (No such file or directory)
------------------------------------------------------
The following is one of the main issues:
# /ubimkvol /dev/ubi0 -N test -mUnable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c1f0c000
[00000000] *pgd=432a6031, *pte=00000000, *ppte=00000000
Internal error: Oops: 817 [#1]
Modules linked in: g_ether musb_hdrc dsplinkk(F)
CPU: 0
PC is at __down_write_nested+0xc8/0x120
LR is at __down_write_nested+0x28/0x120
pc : [<c024d92c>] lr : [<c024d88c>] Tainted: GF
sp : c3289c80 ip : c3289c80 fp : c3289cac
r10: c29b9000 r9 : c1d6d800 r8 : c29b9c00
r7 : 00000000 r6 : c03e6820 r5 : c32c8400 r4 : c3288000
r3 : c32c8404 r2 : c3289c80 r1 : 00000000 r0 : 00000001
Flags: nzcv IRQs off FIQs on Mode SVC_32 Segment user
Control: 5317F
Table: 41F0C000 DAC: 00000015
Process ubimkvol (pid: 705, stack limit = 0xc3288260)
Stack: (0xc3289c80 to 0xc328a000)
9c80: c32c8404 c007f3c8 c03e6820 00000002 00000000 00000000 c1d6d800 7fffefff
9ca0: c3289cbc c3289cb0 c024d998 c024d874 c3289ccc c3289cc0 c00547c8 c024d994
9cc0: c3289ce4 c3289cd0 c01bcbf0 c00547c8 c3289d0c c3289d70 c3289d0c c3289ce8
9ce0: c01bccfc c01bcbcc c1d6d800 c3289d70 c1d6d800 00000000 c1d6dbd0 c3289e68
9d00: c3289d4c c3289d10 c01b8c84 c01bccb0 c3289d34 c3289d20 c017cc2c c017cbe0
9d20: 8139e3f4 00000000 8139e3f4 c3289d38 c29b9140 c3289d70 00000000 00000000
9d40: c3289e4c c3289d50 c01ba444 c01b8be4 c3288000 c29b91e4 00000000 00000000
9d60: 00000400 c0094da8 00000400 c0036934 d50f0000 01000000 00000000 04000001
9d80: 74736574 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9da0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9dc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9de0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9e00: 00000000 00000000 00000000 00000000 00000000 00000000 8139e3f4 c3289e28
9e20: c0043b88 00000000 00000000 000000d5 c3289e68 00000001 c1d6d800 bee7cb78
9e40: c3289f2c c3289e50 c01bbe80 c01b9f44 00000000 ffffffea c28dd280 00000001
9e60: c2975d40 00000000 00000000 00000001 03d59600 00000000 00040003 00000000
9e80: 74736574 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9ea0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9ec0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9ee0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9f00: c3289f08 c2975d40 ffffffe7 40986f00 bee7cb78 00000003 00000000 00900036
9f20: c3289f4c c3289f30 c008fdd4 c01bbc24 c2975d40 c28dd280 bee7cb78 00000036
9f40: c3289f7c c3289f50 c00900bc c008fd68 c2975d40 00000003 00000000 c2975d40
9f60: fffffff7 40986f00 c0023744 c3288000 c3289fa4 c3289f80 c009011c c008fdf8
9f80: 00000005 00000000 c3289fa4 00000003 bee7cf97 bee7cc40 00000000 c3289fa8
9fa0: c0022f60 c00900ec 00000003 bee7cf97 00000003 40986f00 bee7cb78 00000000
9fc0: 00000003 bee7cf97 bee7cc40 bee7cf8a bee7cb78 00000001 03d59600 00000000
9fe0: 400c8340 bee7cb78 0000a858 400c8344 60000010 00000003 00000000 00000000
Backtrace:
[<c024d864>] (__down_write_nested+0x0/0x120) from [<c024d998>] (__down_write+0x14/0x18)
r6:7fffefff r5:c1d6d800 r4:00000000
[<c024d984>] (__down_write+0x0/0x18) from [<c00547c8>] (down_write+0x10/0x14)
[<c00547b8>] (down_write+0x0/0x14) from [<c01bcbf0>] (leb_write_lock+0x34/0x40)
[<c01bcbbc>] (leb_write_lock+0x0/0x40) from [<c01bccfc>] (ubi_eba_unmap_leb+0x5c/0xac)
r4:c3289d70
[<c01bcca0>] (ubi_eba_unmap_leb+0x0/0xac) from [<c01b8c84>] (ubi_change_vtbl_record+0xb0/0x114)
r8:c3289e68 r7:c1d6dbd0 r6:00000000 r5:c1d6d800 r4:c3289d70
[<c01b8bd4>] (ubi_change_vtbl_record+0x0/0x114) from [<c01ba444>] (ubi_create_volume+0x510/0x640)
r7:00000000 r6:00000000 r5:c3289d70 r4:c29b9140
[<c01b9f34>] (ubi_create_volume+0x0/0x640) from [<c01bbe80>] (ubi_cdev_ioctl+0x26c/0x3dc)
[<c01bbc14>] (ubi_cdev_ioctl+0x0/0x3dc) from [<c008fdd4>] (do_ioctl+0x7c/0x90)
[<c008fd58>] (do_ioctl+0x0/0x90) from [<c00900bc>] (vfs_ioctl+0x2d4/0x2f4)
r7:00000036 r6:bee7cb78 r5:c28dd280 r4:c2975d40
[<c008fde8>] (vfs_ioctl+0x0/0x2f4) from [<c009011c>] (sys_ioctl+0x40/0x64)
r9:c3288000 r8:c0023744 r6:40986f00 r5:fffffff7 r4:c2975d40
[<c00900dc>] (sys_ioctl+0x0/0x64) from [<c0022f60>] (ret_fast_syscall+0x0/0x2c)
r6:bee7cc40 r5:bee7cf97 r4:00000003
Code: e5931004 e24b202c e50b302c e5832004 (e5812000)Set volume siznote: ubimkvol[705] exited with preempt_count 2 e to 64329216
BUG: scheduling while atomic: ubimkvol/0x40000002/705 Segmentation fault # # # mount -t ubifs ubi0:test /mnt/dataUBIFS error (pid 709): ubifs_get_sb: cannot open "ubi0:test", error -16
mount: mounting ubi0:test on /mnt/data failed: Device or resource busy #
#
# /ubirmvol /dev/ubi0 -N test
ubirmvol: error!: cannot UBI remove volume
error 16 (Device or resource busy)and so I am not able to use UbiFS :(
Do you have any ideas?
Many thanks in advance,
Stanislav
Quoted 6 lines · Stanislav Popov
Hi all,
I am trying to use UbiFS but having some issues.
I read the documentations and FAQs for UBI and UbiFS. My kernel is pretty old (2.6.21) (I am not able to update it now) but I successfully added UbiFS in it!
How? It is not trivial. Did you use my old 2.6.21 backport tree?
Quoted 12 lines
I have problems with some of the coomands:
------------------------------------------------------# /mtdinfo Count of MTD devices: 6 Present MTD devices: mtdinfo: error!: libmtd failed get MTD device 0 information error 2 (No such file or directory) ------------------------------------------------------ The following is one of the main issues: # /ubiformat /dev//mtd5 ubiformat: error!: cannot get information about "/dev//mtd5" error 2 (No such file or directory)
Do you have /dev/mtd* devices?
What is in /proc/mtd?
Quoted 17 lines
[<
c01bcca0>] (ubi_eba_unmap_leb+0x0/0xac) from [<c01b8c84>] (ubi_change_vtbl_record+0xb0/0x114)
r8:c3289e68 r7:c1d6dbd0 r6:00000000 r5:c1d6d800 r4:c3289d70
[<c01b8bd4>] (ubi_change_vtbl_record+0x0/0x114) from [<c01ba444>] (ubi_create_volume+0x510/0x640)
r7:00000000 r6:00000000 r5:c3289d70 r4:c29b9140
[<c01b9f34>] (ubi_create_volume+0x0/0x640) from [<c01bbe80>] (ubi_cdev_ioctl+0x26c/0x3dc)
[<c01bbc14>] (ubi_cdev_ioctl+0x0/0x3dc) from [<c008fdd4>] (do_ioctl+0x7c/0x90)
[<c008fd58>] (do_ioctl+0x0/0x90) from [<c00900bc>] (vfs_ioctl+0x2d4/0x2f4)
r7:00000036 r6:bee7cb78 r5:c28dd280 r4:c2975d40
[<c008fde8>] (vfs_ioctl+0x0/0x2f4) from [<c009011c>] (sys_ioctl+0x40/0x64)
r9:c3288000 r8:c0023744 r6:40986f00 r5:fffffff7 r4:c2975d40
[<c00900dc>] (sys_ioctl+0x0/0x64) from [<c0022f60>] (ret_fast_syscall+0x0/0x2c)
r6:bee7cc40 r5:bee7cf97 r4:00000003
Quoted 6 lines
Code: e5931004 e24b202c e50b302c e5832004 (e5812000Set volume siznote: ubimkvol[705] exited with
preempt_count2 e to 64329216BUG: scheduling while atomic: ubimkvol/0x40000002/705Segmentation fault
Not sure. Probably related to your back-port. You'll have to debug this yourself.
Signature · 2 lines
Best regards, Artem Bityutskiy (Битюцкий Артём)
Thanks for your reply!
Please find my answers/questions below.
Quoted 4 lines · Artem Bityutskiy
Quoted 2 lines · Stanislav Popov
Hi all,
Quoted 8 lines
Quoted 5 lines
I am trying to use UbiFS but having some issues.
I read the documentations and FAQs for UBI and UbiFS. My kernel is pretty old (2.6.21) (I am not able to update it now) but I successfully added UbiFS in it!How? It is not trivial. Did you use my old 2.6.21 backport tree?
Yes, I ported it with the backport patch.
Quoted 15 lines
Quoted 14 lines
I have problems with some of the coomands:
------------------------------------------------------# /mtdinfo Count of MTD devices: 6 Present MTD devices: mtdinfo: error!: libmtd failed get MTD device 0 information error 2 (No such file or directory) ------------------------------------------------------ The following is one of the main issues: # /ubiformat /dev//mtd5 ubiformat: error!: cannot get information about "/dev//mtd5" error 2 (No such file or directory)
Quoted 4 lines
Do you have
/dev/mtd*devices?
What is in/proc/mtd?
Yes, I have /dev/mtd* devices. What I see in kernel boot message (log is in my first post) is that /dev/mtd5 is successfully attached (ubi.mtd kernel parameter)... Btw it is working using yaffs.
Quoted 14 lines
Quoted 14 lines
[<
c01bcca0>] (ubi_eba_unmap_leb+0x0/0xac) from [<c01b8c84>] (ubi_change_vtbl_record+0xb0/0x114)
r8:c3289e68 r7:c1d6dbd0 r6:00000000 r5:c1d6d800 r4:c3289d70
[<c01b8bd4>] (ubi_change_vtbl_record+0x0/0x114) from [<c01ba444>] (ubi_create_volume+0x510/0x640)
r7:00000000 r6:00000000 r5:c3289d70 r4:c29b9140
[<c01b9f34>] (ubi_create_volume+0x0/0x640) from [<c01bbe80>] (ubi_cdev_ioctl+0x26c/0x3dc) [<c01bbc14>] (ubi_cdev_ioctl+0x0/0x3dc) from [<c008fdd4>] (do_ioctl+0x7c/0x90) [<c008fd58>] (do_ioctl+0x0/0x90) from [<c00900bc>] (vfs_ioctl+0x2d4/0x2f4)
r7:00000036 r6:bee7cb78 r5:c28dd280 r4:c2975d40
[<c008fde8>] (vfs_ioctl+0x0/0x2f4) from [<c009011c>] (sys_ioctl+0x40/0x64)
r9:c3288000 r8:c0023744 r6:40986f00 r5:fffffff7 r4:c2975d40
[<c00900dc>] (sys_ioctl+0x0/0x64) from [<c0022f60>] (ret_fast_syscall+0x0/0x2c)
r6:bee7cc40 r5:bee7cf97 r4:00000003Code: e5931004 e24b202c e50b302c e5832004 (e5812000
Quoted 9 lines
Quoted 5 lines
Set volume siznote: ubimkvol[705] exited with
preempt_count2 e to 64329216BUG: scheduling while atomic: ubimkvol/0x40000002/705Segmentation fault
Not sure. Probably related to your back-port. You'll have to debug this yourself.
Do you have any ideas how can I start debuging it ?
BR,
Stanislav
Quoted 3 lines · Stanislav Popov
Quoted 2 lines
How? It is not trivial. Did you use my old 2.6.21 backport tree?
Yes, I ported it with the backport patch.
What you mean by "the backport patch"? Please, start from my old back-port which you can find here:
http://git.infradead.org/users/dedekind/ubifs-v2.6.21.git
Make sure it works. Then you will have to back port important fixes which are not there.
Quoted 5 lines
Quoted 4 lines
Not sure. Probably related to your back-port. You'll have to debug this yourself.
Do you have any ideas how can I start debuging it ?
Well, inserting printk's to where it oopses, and investigate why. Sorry, I'm not very interested to fix problem very old kernels like 2.6.21. You are on your own here. But I suggest you to start from taking UBIFS stuff fromgit://git.infradead.org/users/dedekind/ubifs-v2.6.21.git
Vs the ubiformat failure - I'll investigate this. I think I screwed up ubiformat in this commit:
http://git.infradead.org/mtd-utils.git?a=commit;h=32252f2b902d88f2991d260f2982b10b2016c33b
so you may try to git-reset to an earlier one so far. But I'll investigate the issue later.
Signature · 2 lines
Best regards, Artem Bityutskiy (Битюцкий Артём)
Quoted 13 lines · Stanislav Popov
I have problems with some of the coomands:
------------------------------------------------------# /mtdinfo Count of MTD devices: 6 Present MTD devices: mtdinfo: error!: libmtd failed get MTD device 0 information error 2 (No such file or directory) ------------------------------------------------------ The following is one of the main issues: # /ubiformat /dev//mtd5 ubiformat: error!: cannot get information about "/dev//mtd5" error 2 (No such file or directory) ------------------------------------------------------
This issue has to be solved in the current mtd-utils, I've just pushed a fix. Please, verify it.
Signature · 2 lines
Best regards, Artem Bityutskiy (Битюцкий Артём)
Hi!
thanks for the patch!
Is this the patch that solves these issues:
http://git.infradead.org/mtd-utils.git?a=commit;h=e783e75e09b4a0a519665afd7bdeaf2985e7a09c
?
Quoted 21 lines · Artem Bityutskiy
Quoted 14 lines · Stanislav Popov
I have problems with some of the coomands:
------------------------------------------------------# /mtdinfo Count of MTD devices: 6 Present MTD devices: mtdinfo: error!: libmtd failed get MTD device 0 information error 2 (No such file or directory) ------------------------------------------------------ The following is one of the main issues: # /ubiformat /dev//mtd5 ubiformat: error!: cannot get information about "/dev//mtd5" error 2 (No such file or directory) ------------------------------------------------------This issue has to be solved in the current mtd-utils, I've just pushed a fix. Please, verify it.
Quoted 6 lines · Stanislav Popov
Hi!
thanks for the patch!Is this the patch that solves these issues:
http://git.infradead.org/mtd-utils.git?a=commit;h=e783e75e09b4a0a519665afd7bdeaf2985e7a09c
?
Right, _supposedly_ solves.
Signature · 2 lines
Best regards, Artem Bityutskiy (Битюцкий Артём)
Cool!
I just made some tests...
ubiformat and mtdinfo are fixed!
Just remaining the issue with ubimkvol kernel panic... :(
Thanks,
Stanislav
Quoted 13 lines · Artem Bityutskiy
Quoted 7 lines · Stanislav Popov
Hi!
thanks for the patch!Is this the patch that solves these issues:
http://git.infradead.org/mtd-utils.git?a=commit;h=e783e75e09b4a0a519665afd7bdeaf2985e7a09c
?Right, _supposedly_ solves.
Quoted 2 lines · Stanislav Popov
I just made some tests...
ubiformat and mtdinfo are fixed!
Thanks.
Quoted 1 line
Just remaining the issue with ubimkvol kernel panic... :(
Try to do what I suggested. It must help.
Signature · 2 lines
Best regards, Artem Bityutskiy (Битюцкий Артём)