Hi Romary, thank you for testing! I must admit that I tried only kernel 3.0 and that didn't give me any weird errors. It's like it's insiting that PEB 100 must be bad and then repeatingly tortures it until it will be... Try changing target/linux/kirkwood/Makefile -LINUX_VERSION:=2.6.37.6 +LINUX_VERSION:=3.0 and recompile and see if the problem persists.
On Wed, Aug 24, 2011 at 12:55:01AM +0200, Romary Sonrier wrote: > Hello guys, > > I applied the 3 patches about ubifs support on kirkwood successfully. > Many thanks Daniel > > I am using linux kernel 2.6.37.6 and mtd-ults 1.4.5. > When erasing, flashing and mounting the first time with mtd-utils from an > initramfs openwrt , it goes well. > > After some umount/mount sequences, I often get many messages about torture > test for PEB, that take 100% of the CPU, like those: > > UBI: run torture test for PEB 100 > UBI: PEB 100 passed torture test, do not mark it a bad > UBI: run torture test for PEB 100 > UBI: PEB 100 passed torture test, do not mark it a bad > UBI: run torture test for PEB 100 > UBI: PEB 100 passed torture test, do not mark it a bad > .... > UBI: PEB 100 passed torture test, do not mark it a bad > UBI: run torture test for PEB 100 > UBI: PEB 100 passed torture test, do not mark it a bad > UBI: run torture test for PEB 100 > > > > Does any know how to solve this issue? > May be the ubo and ubifs code has some bug in kernel 2.6.37.6... > > Here is a full history case: > > * first flashing... > > wget http://x.x.x.x/openwrt--trunk-ubifs > /kirkwood/openwrt-kirkwood-Iconnect-ubi.img > Connecting to x.x.x.x (x.x.x.x:80) > openwrt-kirkwood-Ico 100% |*******************************| 13184k 00:00:00 > ETA > root@OS:/# mtd erase rootfs > Unlocking rootfs ... > Erasing rootfs ... > nand_erase_nand: attempt to erase a bad block at page 0x0001c840 > Failed to erase block on rootfs at 0xe020000 > root@OS:/# ubiformat /dev/mtd2 -f openwrt-kirkwood-Iconnect-ubi.img > ubiformat: mtd2 (nand), size 532676608 bytes (508.0 MiB), 4064 eraseblocks of > 131072 bytes (128.0 KiB), min. I/O size 2048 bytes > libscan: scanning eraseblock 4063 -- 100 % complete > ubiformat: 4063 eraseblocks are supposedly empty > ubiformat: 1 bad eraseblocks found, numbers: 1793 > ubiformat: flashing eraseblock 102 -- 100 % complete > ubiformat: formatting eraseblock 4063 -- 100 % complete > > * then ubiattach , mount, umount, ubidettach sequences: > > root@OS:/# ubiattach /dev/ubi_ctrl -m 2 > UBI: attaching mtd2 to ubi0 > UBI: physical eraseblock size: 131072 bytes (128 KiB) > UBI: logical eraseblock size: 129024 bytes > UBI: smallest flash I/O unit: 2048 > UBI: sub-page size: 512 > UBI: VID header offset: 512 (aligned 512) > UBI: data offset: 2048 > UBI: max. sequence number: 0 > UBI: volume 0 ("rootfs") re-sized from 101 to 4019 LEBs > UBI: attached mtd2 to ubi0 > UBI: MTD device name: "rootfs" > UBI: MTD device size: 508 MiB > UBI: number of good PEBs: 4063 > UBI: number of bad PEBs: 1 > 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: 4063 > UBI: number of PEBs reserved for bad PEB handling: 40 > UBI: max/mean erase counter: 0/0 > UBI: image sequence number: 1623879100 > UBI: background thread "ubi_bgt0d" started, PID 1715 > UBI device number 0, total 4063 LEBs (524224512 bytes, 499.9 MiB), available > 0 LEBs (0 bytes), LEB size 129024 bytes (126.0 KiB) > root@OS:/# mount -t ubifs ubi0:rootfs /mnt > UBIFS: mounted UBI device 0, volume 0, name "rootfs" > UBIFS: file system size: 517128192 bytes (505008 KiB, 493 MiB, 4008 LEBs) > UBIFS: journal size: 9033728 bytes (8822 KiB, 8 MiB, 71 LEBs) > UBIFS: media format: w4/r0 (latest is w4/r0) > UBIFS: default compressor: lzo > UBIFS: reserved for root: 0 bytes (0 KiB) > root@OS:/# > root@OS:/# > root@OS:/# > root@OS:/# > root@OS:/# > root@OS:/# > root@OS:/# umount /mnt > UBIFS: un-mount UBI device 0, volume 0 > root@OS:/# ubidetach -p /dev/mtd2 > UBI: mtd2 is detached from ubi0 > root@OS:/# > root@OS:/# > root@OS:/# > root@OS:/# > root@OS:/# > root@OS:/# lsmod > Module Size Used by Tainted: G > dahdi_echocan_mg2 3572 0 > dahdi_voicebus 30260 0 > dahdi_transcode 3732 0 > dahdi 182672 3 > dahdi_echocan_mg2,dahdi_voicebus,dahdi_transcode > pl2303 9260 0 > usbserial 21364 1 pl2303 > sundance 13568 0 > solos_pci 13996 0 > r8169 25344 0 > e100 22728 0 > pppoe 6768 0 > pppox 948 1 pppoe > pppoatm 1892 0 > clip 7528 0 > ppp_async 5592 0 > ppp_generic 17704 4 pppoe,pppox,pppoatm,ppp_async > slhc 4240 1 ppp_generic > br2684 5560 0 > atm 28692 4 solos_pci,pppoatm,clip,br2684 > ts_fsm 2584 0 > ts_bm 1272 0 > ts_kmp 1144 0 > crc_ccitt 880 2 dahdi,ppp_async > mv_cesa 7372 0 > aes_generic 33208 1 mv_cesa > root@OS:/# ubinfo > UBI version: 1 > Count of UBI devices: 0 > UBI control device major/minor: 10:63 > root@OS:/# ubiattach /dev/ubi_ctrl -m 2 > UBI: attaching mtd2 to ubi0 > UBI: physical eraseblock size: 131072 bytes (128 KiB) > UBI: logical eraseblock size: 129024 bytes > UBI: smallest flash I/O unit: 2048 > UBI: sub-page size: 512 > UBI: VID header offset: 512 (aligned 512) > UBI: data offset: 2048 > UBI: max. sequence number: 4 > UBI: attached mtd2 to ubi0 > UBI: MTD device name: "rootfs" > UBI: MTD device size: 508 MiB > UBI: number of good PEBs: 4063 > UBI: number of bad PEBs: 1 > 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: 4063 > UBI: number of PEBs reserved for bad PEB handling: 40 > UBI: max/mean erase counter: 1/0 > UBI: image sequence number: 1623879100 > UBI: background thread "ubi_bgt0d" started, PID 1724 > UBI device number 0, total 4063 LEBs (524224512 bytes, 499.9 MiB), available > 0 LEBs (0 bytes), LEB size 129024 bytes (126.0 KiB) > root@OS:/# mount -t ubifs ubi0:rootfs /mnt > UBIFS: mounted UBI device 0, volume 0, name "rootfs" > UBIFS: file system size: 517128192 bytes (505008 KiB, 493 MiB, 4008 LEBs) > UBIFS: journal size: 9033728 bytes (8822 KiB, 8 MiB, 71 LEBs) > UBIFS: media format: w4/r0 (latest is w4/r0) > UBIFS: default compressor: lzo > UBIFS: reserved for root: 0 bytes (0 KiB) > root@OS:/# ls /mnt > bin etc mnt proc root sys usr www > dev lib overlay rom sbin tmp var > root@OS:/# umount /mnt > UBIFS: un-mount UBI device 0, volume 0 > root@OS:/# ubidetach -p /dev/mtd2 > UBI: mtd2 is detached from ubi0 > root@OS:/# ubiattach /dev/ubi_ctrl -m 2 > UBI: attaching mtd2 to ubi0 > UBI: physical eraseblock size: 131072 bytes (128 KiB) > UBI: logical eraseblock size: 129024 bytes > UBI: smallest flash I/O unit: 2048 > UBI: sub-page size: 512 > UBI: VID header offset: 512 (aligned 512) > UBI: data offset: 2048 > UBI: max. sequence number: 5 > UBI: attached mtd2 to ubi0 > UBI: MTD device name: "rootfs" > UBI: MTD device size: 508 MiB > UBI: number of good PEBs: 4063 > UBI: number of bad PEBs: 1 > 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: 4063 > UBI: number of PEBs reserved for bad PEB handling: 40 > UBI: max/mean erase counter: 1/0 > UBI: image sequence number: 1623879100 > UBI: background thread "ubi_bgt0d" started, PID 1732 > UBI device number 0, total 4063 LEBs (524224512 bytes, 499.9 MiB), available > 0 LEBs (0 bytes), LEB size 129024 bytes (126.0 KiB) > root@OS:/# > root@OS:/# > root@OS:/# > root@OS:/# mount -t ubifs ubi0:rootfs /mnt > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBIFS: mounted UBI device 0, volume 0, name "rootfs" > UBIFS: file system size: 517128192 bytes (505008 KiB, 493 MiB, 4008 LEBs) > UBIFS: journal size: 9033728 bytes (8822 KiB, 8 MiB, 71 LEBs) > UBIFS: media format: w4/r0 (latest is w4/r0) > UBIFS: default compressor: lzo > UBIFS: reserved for root: 0 bytes (0 KiB) > UBI: run torture test for PEB 103 > root@OS:/# UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > UBI: PEB 103 passed torture test, do not mark it a bad > UBI: run torture test for PEB 103 > Bug easy to reproduce from a initramfs. > > Any idea ? > > Romary > > Le 05/08/2011 14:48, Daniel Golle a écrit : > > Enable ubifs on kirkwood (tested it with SheevaPlug). > > Signed-off-by: Daniel Golle <dgo...@allnet.de><mailto:dgo...@allnet.de> > > Index: target/linux/kirkwood/image/ubinize.cfg > =================================================================== > --- target/linux/kirkwood/image/ubinize.cfg (revision 0) > +++ target/linux/kirkwood/image/ubinize.cfg (revision 0) > @@ -0,0 +1,14 @@ > +[rootfs] > +# Volume mode (other option is static) > +mode=ubi > +# Source image > +image=root.ubifs > +# Volume ID in UBI image > +vol_id=0 > +# Allow for dynamic resize > +vol_type=dynamic > +# Volume name > +vol_name=rootfs > +# Autoresize volume at first mount > +vol_flags=autoresize > + > Index: target/linux/kirkwood/image/Makefile > =================================================================== > --- target/linux/kirkwood/image/Makefile (revision 27890) > +++ target/linux/kirkwood/image/Makefile (working copy) > @@ -8,6 +8,8 @@ > include $(INCLUDE_DIR)/image.mk > > JFFS2OPTS += --little-endian --pagesize=0x800 --no-cleanmarkers --pad > +UBIFS_OPTS += -m 2048 -e 126KiB -c 8192 > +UBINIZE_OPTS += -m 2048 -p 128KiB -O 512 > > define Image/Prepare > cp $(LINUX_DIR)/arch/arm/boot/uImage $(KDIR)/uImage > Index: target/linux/kirkwood/Makefile > =================================================================== > --- target/linux/kirkwood/Makefile (revision 27890) > +++ target/linux/kirkwood/Makefile (working copy) > @@ -9,7 +9,7 @@ > ARCH:=arm > BOARD:=kirkwood > BOARDNAME:=Marvell Kirkwood > -FEATURES:=targz usb jffs2 > +FEATURES:=targz usb jffs2 ubifs > MAINTAINER:=Imre Kaloz <ka...@openwrt.org><mailto:ka...@openwrt.org> > > LINUX_VERSION:=2.6.37.6 > Index: target/linux/kirkwood/config-default > =================================================================== > --- target/linux/kirkwood/config-default (revision 27890) > +++ target/linux/kirkwood/config-default (working copy) > @@ -110,6 +110,11 @@ > # CONFIG_MTD_ROOTFS_ROOT_DEV is not set > # CONFIG_MTD_ROOTFS_SPLIT is not set > # CONFIG_MTD_SM_COMMON is not set > +CONFIG_MTD_UBI=y > +CONFIG_MTD_UBI_BEB_RESERVE=1 > +# CONFIG_MTD_UBI_DEBUG is not set > +# CONFIG_MTD_UBI_GLUEBI is not set > +CONFIG_MTD_UBI_WL_THRESHOLD=4096 > CONFIG_MV643XX_ETH=y > CONFIG_NEED_DMA_MAP_STATE=y > CONFIG_NET_DSA=y > @@ -138,6 +143,12 @@ > # CONFIG_SERIAL_8250_EXTENDED is not set > CONFIG_SPLIT_PTLOCK_CPUS=999999 > CONFIG_SYS_SUPPORTS_APM_EMULATION=y > +CONFIG_UBIFS_FS=y > +CONFIG_UBIFS_FS_ADVANCED_COMPR=y > +# CONFIG_UBIFS_FS_DEBUG is not set > +# CONFIG_UBIFS_FS_LZO is not set > +# CONFIG_UBIFS_FS_XATTR is not set > +CONFIG_UBIFS_FS_ZLIB=y > CONFIG_UID16=y > CONFIG_USB=y > CONFIG_USB_EHCI_HCD=y > _______________________________________________ > openwrt-devel mailing list > openwrt-devel@lists.openwrt.org<mailto:openwrt-devel@lists.openwrt.org> > https://lists.openwrt.org/mailman/listinfo/openwrt-devel > > > _______________________________________________ > openwrt-devel mailing list > openwrt-devel@lists.openwrt.org > https://lists.openwrt.org/mailman/listinfo/openwrt-devel _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel