This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Errors when fastbooting ubi.img to NAND

Other Parts Discussed in Thread: TLV320AIC23, AM3517

Hi,

I fastboot ubi.img to NAND, and the file system can start up, but not completely.

1. Lots of errors like this show up,

request_suspend_state: wakeup (0->0) at 155900817876 (2000-01-01 00:12:05.870483401 UTC)
init: untracked pid 1320 exited
UBIFS error (pid 849): make_reservation: cannot reserve 160 bytes in jhead 1, error -30
UBIFS error (pid 849): ubifs_write_inode: can't write inode 770, error -30
UBIFS error (pid 1348): make_reservation: cannot reserve 424 bytes in jhead 1, error -30
UBIFS error (pid 1348): ubifs_create: cannot create regular file, error -30

pid 849 is flush-ubifs_0_0 process, in process list,

root      849   2     0      0     c00c9594 00000000 S flush-ubifs_0_0

2. my root file system is read only, I can't create file or write to a file in my ubifs system.

In the kernel log, something related are like this,

UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 1540:512, written 0 bytes
UBI warning: recover_peb: failed to write to PEB 1540
UBI warning: ubi_ro_mode: switch to read-only mode
UBIFS error (pid 849): ubifs_wbuf_write_nolock: cannot write 3874 bytes to LEB 477:10240, error -5
UBIFS warning (pid 849): ubifs_ro_mode: switched to read-only mode, error -5
UBIFS error (pid 849): do_writepage: cannot write page 3 of inode 771, error -5

pid 849 is flush-ubifs_0_0.

3. Android processes do not start up, and zygote do not start up either.

USER     PID   PPID  VSIZE  RSS     WCHAN    PC         NAME
root      1     0     260    176   c00bc3f8 0000875c S /init
root      2     0     0      0     c006de6c 00000000 S kthreadd
root      3     2     0      0     c0060928 00000000 S ksoftirqd/0
root      4     2     0      0     c0084ab8 00000000 S watchdog/0
root      5     2     0      0     c006ae4c 00000000 S events/0
root      6     2     0      0     c006ae4c 00000000 S khelper
root      10    2     0      0     c0073444 00000000 S async/mgr
root      13    2     0      0     c006ae4c 00000000 S suspend
root      205   2     0      0     c00997f4 00000000 S sync_supers
root      207   2     0      0     c009a024 00000000 S bdi-default
root      209   2     0      0     c006ae4c 00000000 S kblockd/0
root      221   2     0      0     c006ae4c 00000000 S ksuspend_usbd
root      225   2     0      0     c0238558 00000000 S khubd
root      228   2     0      0     c026125c 00000000 S kseriod
root      249   2     0      0     c006ae4c 00000000 S kmmcd
root      265   2     0      0     c006ae4c 00000000 S musb_hdrc
root      267   2     0      0     c006ae4c 00000000 S rpciod/0
root      274   2     0      0     c0084cb0 00000000 S khungtaskd
root      275   2     0      0     c0094e9c 00000000 S kswapd0
root      277   2     0      0     c006ae4c 00000000 S aio/0
root      278   2     0      0     c006ae4c 00000000 S nfsiod
root      279   2     0      0     c006ae4c 00000000 S crypto/0
root      429   2     0      0     c0218300 00000000 S mtdblockd
root      451   2     0      0     c0228234 00000000 S ubi_bgt0d
root      495   2     0      0     c006ae4c 00000000 S kondemand/0
root      496   2     0      0     c006ae4c 00000000 S kconservative/0
root      503   2     0      0     c006ae4c 00000000 S usbhid_resumer
root      538   2     0      0     c01747d8 00000000 S ubifs_bgt0_0
root      539   1     236    144   c00bc3f8 0000875c S /sbin/ueventd
root      795   1     692    324   c01e3bfc afd0b45c S /system/bin/sh
system    797   1     764    284   c02b0c68 afd0b6fc S /system/bin/servicemanagr
root      798   1     3872   676   ffffffff afd0bdac S /system/bin/vold
root      800   1     3840   652   ffffffff afd0bdac S /system/bin/netd
root      801   1     624    268   c02e51c4 afd0c0cc S /system/bin/debuggerd
root      802   1     1244   584   c00716e0 afd0bdac S /system/bin/rild
bluetooth 806   1     1212   584   c00bc3f8 afd0c59c S /system/bin/dbus-daemon
root      807   1     764    276   c02e51c4 afd0c0cc S /system/bin/installd
root      810   1     3356   164   ffffffff 00008294 S /sbin/adbd
root      849   2     0      0     c00c9594 00000000 S flush-ubifs_0_0
media     1106  1     16792  4660  ffffffff afd0b6fc S /system/bin/mediaserver
root      1111  810   692    336   c005e628 afd0c3ac S /system/bin/sh
root      1112  1     692    332   c005e628 afd0c3ac S /system/bin/sh
root      1117  1112  840    284   c00716e0 afd0bdac S sleep
root      1118  1111  848    316   00000000 afd0b45c R ps

4. kernel log is attached. 5710.log-ubifs-error.txt

 

I have no idea about this, anyone can give me any suggestions?

Thanks in advance for any help.

 

Regards,

Kevin

 

  • Hi Kevin,

     

    Could you give us more details about which release and which board you are using for your development ? It will help us to analyze further.

     

    BR,

    satish

  • Hi Satish Patel,

    I am using TI_Android_GingerBread_2_3_DevKit_1_0, and testing the ubifs on two different boards.

    First board is am3517evm, it works OK, and kernel can boot ubifs, android desktop can start up. except some errors on the console,

    tlv320aic23_write cannot write 000 to register R15
    asoc: tlv320aic23 <-> omap-mcbsp-dai-0 mapping ok
    tlv320aic23_write cannot write 001 to register R9
    tlv320aic23_write cannot write 004 to register R5
    tlv320aic23_write cannot write 117 to register R0
    tlv320aic23_write cannot write 117 to register R1
    tlv320aic23_write cannot write 010 to register R4
    tlv320aic23_write cannot write 070 to register R2
    tlv320aic23_write cannot write 070 to register R3
    tlv320aic23_write cannot write 001 to register R9

    tlv320aic23_write cannot write 043 to register R7
    tlv320aic23_write cannot write 07f to register R8
    tlv320aic23_write cannot write 043 to register R7
    tlv320aic23_write cannot write 001 to register R9
    tlv320aic23_write cannot write 007 to register R6
    tlv320aic23_write cannot write 004 to register R5
    tlv320aic23_write cannot write 00c to register R5
    tlv320aic23_write cannot write 000 to register R9
    tlv320aic23_write cannot write 043 to register R7
    tlv320aic23_write cannot write 07f to register R8
    tlv320aic23_write cannot write 043 to register R7
    tlv320aic23_write cannot write 001 to register R9
    tlv320aic23_write cannot write 004 to register R5

     

    Second board is the same as am3517evm but NAND, I substituted Samsung K9F4G08U0A (512MiB 3,3V 8-bit) for Micron MT29F4G16ABCHO(512MiB 3,3V 16-bit),I have made some changes to x-loader and u-boot to let x-loader and u-boot work, and system now can startup, but android desktop can't.

    There are lots of kernel errors repeatedly on the console such as

    UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB 2040:32768, written 0 bytes
    UBI warning: ubi_eba_write_leb: failed to write data to PEB 2040
    UBI: recover PEB 2040, move data to PEB 1522
    UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 1522:512, written 0 bytes
    UBI warning: recover_peb: failed to write to PEB 1522
    UBI: try again
    UBI: recover PEB 2040, move data to PEB 1523
    UBI: run torture test for PEB 1522
    UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 1523:512, written 0 bytes
    UBI warning: recover_peb: failed to write to PEB 1523
    UBI: try again
    UBI: recover PEB 2040, move data to PEB 1524
    UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 1524:512, written 0 bytes
    UBI warning: recover_peb: failed to write to PEB 1524
    UBI: try again
    UBI: recover PEB 2040, move data to PEB 1525
    UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 1525:512, written 0 bytes
    UBI warning: recover_peb: failed to write to PEB 1525
    UBI warning: ubi_ro_mode: switch to read-only mode
    UBIFS error (pid 828): ubifs_wbuf_write_nolock: cannot write 4144 bytes to LEB 477:30720, error -5
    UBIFS warning (pid 828): ubifs_ro_mode: switched to read-only mode, error -5
    UBIFS error (pid 828): do_writepage: cannot write page 8 of inode 769, error -5
    UBI error: ubi_io_write: read-only mode
    UBI error: erase_worker: failed to erase PEB 1522, error -30
    UBI error: do_work: work failed with error code -30
    UBI error: ubi_thread: ubi_bgt0d: work failed with error code -30
    UBIFS error (pid 780): make_reservation: cannot reserve 392 bytes in jhead 1, error -30
    UBIFS error (pid 780): ubifs_mkdir: cannot create directory, error -30
    UBIFS error (pid 782): make_reservation: cannot reserve 424 bytes in jhead 1, error -30
    UBIFS error (pid 782): ubifs_create: cannot create regular file, error -30

     

    I tried two ways to flash ubi.img to NAND, though fastboot and through u-boot command, the results are the same.

    I want to know should I do any changes to the kernel  if I changed NAND?

     

    If you want any other details, please let me know, I will provide ASAP.

     

    Thanks,

    Kevin

     

     


  • Hi Satish,

    I also tried mtd-utils in the system running on MMC, the procedure and logs are posted on Thu, May 26 2011 2:46 AM at

    http://e2e.ti.com/support/embedded/f/509/p/111277/400322.aspx#400322

    Hope it helps.

     

    Thanks,

    Kevin

  • Hi,

    I found the following bold errors are printed in ubi driver in kernel, kernel/drivers/mtd/ubi/io.c, could be the ubi driver's problem?

    UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 2326:0, written 0 bytes
    UBI error: erase_worker: failed to erase PEB 2326, error -5
    UBI: mark PEB 2326 as bad
    UBI: 38 PEBs left in the reserve
    UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 2599:0, written 0 bytes
    UBI error: erase_worker: failed to erase PEB 2599, error -5
    UBI: mark PEB 2599 as bad
    UBI error: ubi_io_mark_bad: cannot mark PEB 2599 bad, error -5
    UBI warning: ubi_ro_mode: switch to read-only mode
    UBI error: do_work: work failed with error code -5
    UBI error: ubi_thread: ubi_bgt0d: work failed with error code -5
    UBIFS error (pid 870): ubifs_wbuf_write_nolock: cannot write 3778 bytes to LEB 477:0, error -30
    UBIFS warning (pid 870): ubifs_ro_mode: switched to read-only mode, error -30
    UBIFS error (pid 870): do_writepage: cannot write page 0 of inode 769, error -30
    UBIFS error (pid 802): make_reservation: cannot reserve 424 bytes in jhead 1, error -30
    UBIFS error (pid 802): ubifs_create: cannot create regular file, error -30
    UBIFS error (pid 802): make_reservation: cannot reserve 416 bytes in jhead 1, error -30
    UBIFS error (pid 802): ubifs_create: cannot create regular file, error -30
    UBIFS error (pid 802): make_reservation: cannot reserve 424 bytes in jhead 1, error -30
    UBIFS error (pid 802): ubifs_create: cannot create regular file, error -30


    I haven't found a better way to solve it. any suggestions?

    Thanks,

  • Hi,

    In my opinion, I think NAND drivers is OK.

    The layers of the UBI, is Hardware Driver -> MTD -> UBI -> UBIFS, since rootfs.jffs2 works ok,  the layer of Hardware Drivers -> MTD should be ok.

    In the kernel log,

    UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 3935:0, written 0 bytes
    UBI error: erase_worker: failed to erase PEB 3935, error -5
    UBI: mark PEB 3935 as bad
    UBI error: ubi_io_mark_bad: cannot mark PEB 3935 bad, error -5
    UBI warning: ubi_ro_mode: switch to read-only mode
    UBI error: do_work: work failed with error code -5
    UBI error: ubi_thread: ubi_bgt0d: work failed with error code -5
    omaplfb: OMAPLFB_Init: OMAPLFBInit failed
    UBIFS error (pid 845): ubifs_wbuf_write_nolock: cannot write 3778 bytes to LEB 477:0, error -30
    UBIFS warning (pid 845): ubifs_ro_mode: switched to read-only mode, error -30
    UBIFS error (pid 845): do_writepage: cannot write page 0 of inode 770, error -30
    UBIFS error (pid 782): make_reservation: cannot reserve 424 bytes in jhead 1, error -30
    UBIFS error (pid 782): ubifs_create: cannot create regular file, error -30

    UBI error printed firstly, and then the UBIFS errors, so the problem may be in the layer MTD -> UBI, this problem leads to another problem in the above layer   UBI -> UBIFS,

     

    Thanks,

    Kevin

  • Hi Kevin,

    Replied on a similar thread of yours http://e2e.ti.com/support/embedded/f/509/p/111434/410995.aspx#410995

    Requesting you stick to one E2E thread, that will help us in tracking this issue.

    Regards,
    Amit Pundir

  • Just to close the post. The problem has been fixed.

    The AM3517 processor supports NAND prefetch and prefetch DMA, so I enabled MTD_NAND_OMAP_PREFETCH and MTD_NAND_OMAP_PREFETCH_DMA in kernel config, then the errors didn't come up any more, the android system can start up from NAND successfully now.

     

    Regards,

    Kevin