UBIFS Corrupt during power failure

Eric Holmberg Eric_Holmberg at Trimble.com
Tue May 19 18:16:17 EDT 2009


> On Mon, 2009-05-18 at 11:30 -0600, Eric Holmberg wrote:
> > Hi Stefan,
> > 
> > I am still seeing corruption even with the write buffer 
> size limited to
> > 8 bytes, but it's greatly limited.
> 
> Do you mean, UBIFS still dies when buf. size is 8?
> 
> -- 
> Best regards,
> Artem Bityutskiy (Битюцкий Артём)


Yes, I'm still seeing two failures.  One is where I get 2 corrupt empty blocks when an LEB erase operation is interrupted by a power failure.  Erasing one of them manually in U-Boot allows the system to boot.  I believe this happens when an LEB erase operation is interrupted and then during the deferred recovery, another erase operation is interrupted.  The system never expects to have more than one erase operation interrupted and panics.

The other failure is a corruption issue, even with the write buffer size limited to 8 bytes.  Scroll down to the end of the kernel messages for the failure.

I unfortunately didn't get a chance to get an image of the flash to see what happened to the data block before the board was reprogrammed.  I'm trying to reproduce it so I can get more details on what is happening.

[42949374.110000] physmap platform flash device: 02000000 at 30000000
[42949374.110000] Number of erase regions: 1
[42949374.120000] Warning:  Overriding MaxBufWriteSize from 2^6 to 2^3
[42949374.120000] Primary Vendor Command Set: 0002 (AMD/Fujitsu Standard)
[42949374.130000] Primary Algorithm Table at 0040
[42949374.140000] Alternative Vendor Command Set: 0000 (None)
[42949374.140000] No Alternate Algorithm Table
[42949374.140000] Vcc Minimum:  2.7 V
[42949374.150000] Vcc Maximum:  3.6 V
[42949374.150000] No Vpp line
[42949374.150000] Typical byte/word write timeout: 64 µs
[42949374.160000] Maximum byte/word write timeout: 512 µs
[42949374.160000] Typical full buffer write timeout: 64 µs
[42949374.170000] Maximum full buffer write timeout: 2048 µs
[42949374.180000] Typical block erase timeout: 512 ms
[42949374.180000] Maximum block erase timeout: 4096 ms
[42949374.180000] Typical chip erase timeout: 524288 ms
[42949374.190000] Maximum chip erase timeout: 2097152 ms
[42949374.190000] Device size: 0x2000000 bytes (32 MiB)
[42949374.200000] Flash Device Interface description: 0x0002
[42949374.210000]   - supports x8 and x16 via BYTE# with asynchronous interface
[42949374.210000] Max. bytes in buffer write: 0x8
[42949374.220000] Number of Erase Block Regions: 1
[42949374.220000]   Erase Region #0: BlockSize 0x20000 bytes, 256 blocks
[42949374.230000] physmap-flash.1: Found 1 x16 devices at 0x0 in 16-bit bank
[42949374.230000]  Amd/Fujitsu Extended Query Table at 0x0040
[42949374.240000]   Silicon revision: 10
[42949374.240000]   Address sensitive unlock: Required
[42949374.250000]   Erase Suspend: Read/write
[42949374.250000]   Block protection: 1 sectors per group
[42949374.260000]   Temporary block unprotect: Not supported
[42949374.260000]   Block protect/unprotect scheme: 8
[42949374.270000]   Number of simultaneous operations: 0
[42949374.270000]   Burst mode: Not supported
[42949374.280000]   Page mode: 8 word page
[42949374.280000]   Vpp Supply Minimum Program/Erase Voltage: 11.5 V
[42949374.290000]   Vpp Supply Maximum Program/Erase Voltage: 12.5 V
[42949374.290000]   Top/Bottom Boot Block: Uniform, Bottom WP
[42949374.300000]   Write buffers enabled
[42949374.300000] physmap-flash.1: CFI does not contain boot bank location. Assuming top.
[42949374.310000] number of CFI chips: 1
[42949374.310000] cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
[42949374.320000] RedBoot partition parsing not available
[42949374.330000] Using physmap partition information
[42949374.330000] Creating 3 MTD partitions on "physmap-flash.1":
[42949374.340000] 0x00000000-0x00200000 : "kernel"
[42949374.350000] 0x00200000-0x00400000 : "kernel-failsafe"
[42949374.360000] 0x00400000-0x02000000 : "root"
[42949374.370000] UBI: attaching mtd7 to ubi0
[42949374.370000] UBI: physical eraseblock size:   131072 bytes (128 KiB)
[42949374.380000] UBI: logical eraseblock size:    130944 bytes
[42949374.380000] UBI: smallest flash I/O unit:    1
[42949374.390000] UBI: VID header offset:          64 (aligned 64)
[42949374.390000] UBI: data offset:                128
[42949375.090000] UBI: attached mtd7 to ubi0
[42949375.090000] UBI: MTD device name:            "root"
[42949375.100000] UBI: MTD device size:            28 MiB
[42949375.110000] UBI: number of good PEBs:        224
[42949375.110000] UBI: number of bad PEBs:         0
[42949375.110000] UBI: max. allowed volumes:       128
[42949375.120000] UBI: wear-leveling threshold:    4096
[42949375.120000] UBI: number of internal volumes: 1
[42949375.130000] UBI: number of user volumes:     1
[42949375.130000] UBI: available PEBs:             0
[42949375.140000] UBI: total number of reserved PEBs: 224
[42949375.140000] UBI: number of PEBs reserved for bad PEB handling: 0
[42949375.150000] UBI: max/mean erase counter: 85/21
...
[42949375.620000] UBIFS: recovery needed
[42949375.630000] UBIFS: recovery needed - but mounted in read-only mode
[42949375.770000] UBIFS error (pid 1): ubifs_check_node: bad CRC: calculated 0xa2ef18b9, read 0x5ebf03c1
[42949375.780000] UBIFS error (pid 1): ubifs_check_node: bad node at LEB 120:0
[42949375.790000] UBIFS error (pid 1): ubifs_scanned_corruption: corrupted data at LEB 120:0
[42949375.810000] UBIFS error (pid 1): ubifs_recover_leb: LEB 120 scanning failed
[42949375.820000] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)
[42949375.830000] Please append a correct "root=" boot option; here are the available partitions:
[42949375.840000] 1f00         16 mtdblock0 (driver?)
[42949375.840000] 1f01          8 mtdblock1 (driver?)
[42949375.850000] 1f02          8 mtdblock2 (driver?)
[42949375.850000] 1f03         32 mtdblock3 (driver?)
[42949375.860000] 1f04        960 mtdblock4 (driver?)
[42949375.860000] 1f05       2048 mtdblock5 (driver?)
[42949375.870000] 1f06       2048 mtdblock6 (driver?)
[42949375.870000] 1f07      28672 mtdblock7 (driver?)
[42949375.880000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)


Getting the failures to occur using physical hardware takes 7 or 8 hours which is why I would like to modify either the drivers/mtd/devices/block2mtd.c NOR simulator or the RAM simulator and put in the interrupted flash patterns that I've already characterized.  Any ideas on how to simulate a power failure in either module and then do a UBIFS remount?

-Eric


More information about the linux-mtd mailing list