Dear All,
I'm trying to use ubifs on NAND(Samsung K9F2G08UGC) of our AM3517 custom board.
It works fine several hours or sometimes tens of days,
but got freezed with the following messages.
[ 1664.949279] UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB 1839:118784, written 0 bytes
[ 1664.959167] UBI warning: ubi_eba_write_leb: failed to write data to PEB 1839
[ 1664.966278] UBI: recover PEB 1839, move data to PEB 1011
[ 1665.042999] UBI error: ubi_io_write: error -5 while writing 116736 bytes to PEB 1011:4096, written 40960 bytes
[ 1665.052978] UBI warning: recover_peb: failed to write to PEB 1011
[ 1665.059143] UBI: try again
[ 1665.061859] UBI: recover PEB 1839, move data to PEB 1012
[ 1665.136749] UBI error: ubi_io_write: error -5 while writing 116736 bytes to PEB 1012:4096, written 40960 bytes
[ 1665.146911] UBI warning: recover_peb: failed to write to PEB 1012
[ 1665.153137] UBI: try again
[ 1665.155822] UBI: recover PEB 1839, move data to PEB 1013
[ 1665.239959] UBI: data was successfully recovered
[ 1665.972717] UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB 659:67584, written 0 bytes
[ 1665.982421] UBI warning: ubi_eba_write_leb: failed to write data to PEB 659
[ 1665.989440] UBI: recover PEB 659, move data to PEB 1014
[ 1666.052215] UBI: data was successfully recovered
[ 1666.712554] UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 1334:0, written 0 bytes
[ 1666.721832] UBI error: erase_worker: failed to erase PEB 1334, error -5
[ 1666.728424] UBI: mark PEB 1334 as bad
[ 1666.749969] UBI error: ubi_io_mark_bad: cannot mark PEB 1334 bad, error -5
[ 1666.756896] UBI warning: ubi_ro_mode: switch to read-only mode
[ 1666.762756] UBI error: do_work: work failed with error code -5
[ 1666.768524] UBI error: ubi_thread: ubi_bgt0d: work failed with error code -5
[ 1666.816406] UBIFS error (pid 791): ubifs_wbuf_write_nolock: cannot write 2240 bytes to LEB 961:12288, error -30
[ 1666.826446] UBIFS warning (pid 791): ubifs_ro_mode: switched to read-only mode, error -30
[ 1666.834564] UBIFS error (pid 791): do_writepage: cannot write page 70 of inode 35509, error -30
[ 1666.872283] UBIFS error (pid 791): make_reservation: cannot reserve 160 bytes in jhead 1, error -30
[ 1666.881347] UBIFS error (pid 791): ubifs_write_inode: can't write inode 35509, error -30
As above messages, the recovery was successful but, marking bad block(ubi_io_mark_bad) failed.
Please give me any hint or advice on it...
I started with TI-Android-FroYo-DevKit-V2.2 (http://processors.wiki.ti.com/index.php/TI-Android-FroYo-DevKit-V2.2_UserGuide)
and make ubi image as followings.
# mkfs.ubifs -r temp/ -m 2048 -e 126976 -c 1948 -o ubifs.img
# /mkfs.ubifs -r temp/ -m 2048 -e 126976 -c 1948 -o ubifs.img
[ubifs]
mode=ubi
image=ubifs.img
vol_id=0
vol_size=200MiB
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize
nandargs=setenv bootargs console=${console} eth=${ethaddr} init=/init noinitrd ip=off rootwait mem=256M mpurate=600 root=ubi0:rootfs rw ubi.mtd=4,2048 rootfstype=ubifs rootdelay=2 omap_vout.vid1_static_vrfb_alloc=y vram=16M
[ 132.138702] omap2-nand driver initializing
[ 132.143005] NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
[ 132.151611] Creating 5 MTD partitions on "omap2-nand.0":
[ 132.156890] 0x000000000000-0x000000080000 : "xloader-nand"
[ 132.164154] 0x000000080000-0x000000240000 : "uboot-nand"
[ 132.171417] 0x000000240000-0x000000280000 : "params-nand"
[ 132.178039] 0x000000280000-0x000000780000 : "linux-nand"
[ 132.186462] 0x000000780000-0x000010000000 : "rootfs"
[ 132.295532] UBI: attaching mtd4 to ubi0
[ 132.299316] UBI: physical eraseblock size: 131072 bytes (128 KiB)
[ 132.305603] UBI: logical eraseblock size: 126976 bytes
[ 132.310974] UBI: smallest flash I/O unit: 2048
[ 132.315612] UBI: sub-page size: 512
[ 132.320190] UBI: VID header offset: 2048 (aligned 2048)
[ 132.326141] UBI: data offset: 4096
[ 133.125396] UBI warning: ubi_eba_init_scan: cannot reserve enough PEBs for bad PEB handling, reserved 10, need 19
[ 133.137542] UBI: attached mtd4 to ubi0
[ 133.141265] UBI: MTD device name: "rootfs"
[ 133.146301] UBI: MTD device size: 248 MiB
[ 133.151214] UBI: number of good PEBs: 1971
[ 133.155883] UBI: number of bad PEBs: 17
[ 133.160369] UBI: max. allowed volumes: 128
[ 133.164916] UBI: wear-leveling threshold: 4096
[ 133.169586] UBI: number of internal volumes: 1
[ 133.173980] UBI: number of user volumes: 1
[ 133.178375] UBI: available PEBs: 0
[ 133.182769] UBI: total number of reserved PEBs: 1971
[ 133.187683] UBI: number of PEBs reserved for bad PEB handling: 10
[ 133.193725] UBI: max/mean erase counter: 45/26
[ 133.198120] UBI: image sequence number: 1281654017
[ 133.203002] UBI: background thread "ubi_bgt0d" started, PID 402