I am using evm board and follow this steps:
1: I use the 8bit nand and ubifs, flashed uboot and kernel and ramdisk, run into kernel.
2: In kernel, I mounted the ubi partion, and put a tar file in this ubi partion.
ubiformat /dev/mtd/mtd6 -s 512 -O 2048
ubiattach /dev/ubi_ctrl -m 6 -O 2048
ubimkvol /dev/ubi0 -N rootfs -s 80MiB
mount -t ubifs ubi0_0 /mnt
3: I put a file(*.tar.gz) in ubi partion and tar it.
cd /mnt/
tftp -r u-boot-2010.06-psp04.04.00.01.tar.gz -g 192.168.1.2
tar jxvf u-boot-2010.06-psp04.04.00.01.tar.gz
4: It comes error, this is some error log:
UBI error: ubi_io_write: error -5 while writing 131072 bytes to PEB 88:0, written 81920 bytes
UBI error: erase_worker: failed to erase PEB 88, error -5
UBI: mark PEB 88 as bad
UBI: 7 PEBs left in the reserve
UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB 397:55296, written 0 bytes
UBI warning: ubi_eba_write_leb: failed to write data to PEB 397
UBI: recover PEB 397, move data to PEB 398
UBI: data was successfully recovered
UBI: run torture test for PEB 397
UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB 398:94208, written 0 bytes
UBI warning: ubi_eba_write_leb: failed to write data to PEB 398
UBI: recover PEB 398, move data to PEB 399
UBI error: ubi_io_write: error -5 while writing 131072 bytes to PEB 397:0, written 0 bytes
UBI error: erase_worker: failed to erase PEB 397, error -5
UBI: reserve more 1 PEBs
UBI: mark PEB 397 as bad
UBI: 7 PEBs left in the reserve
UBI error: ubi_io_write: error -5 while writing 92160 bytes to PEB 399:4096, written 0 bytes
UBI warning: recover_peb: failed to write to PEB 399
UBI: try again
UBI: recover PEB 398, move data to PEB 400
UBI: run torture test for PEB 399
when i copy a large file from usb disk to the ubi partion, it looks working well. and i did some mtdtest, it works well also!
So, i guess the 8bit nand flash is not stable. The tar operation is more complex(it will read file and wirte lots of file at same time)
PS:
The nand flas is K9K8G08U0A, and it's device id is not in the Supported NAND Devices list!
So, can you give me some suggest to fix the bug in nand driver?