ubi_eba_init_scan: cannot reserve enough PEBs

Matthew L. Creech mlcreech at gmail.com
Mon Jul 26 17:13:20 EDT 2010


Hi Artem, thanks for the reply.  Responses below:

On Mon, Jul 26, 2010 at 1:21 AM, Artem Bityutskiy <dedekind1 at gmail.com> wrote:
>
> UBI wants 1% of PEBs to be reserved for bad block handling.
>

OK, so with my flash layout it wants to reserve 81 blocks for bad PEB
handling, and does so when first initialized.  Then during the course
of normal device operation (lots of reads & writes), let's say 8 more
of them go bad that weren't factory bad blocks.  Will it now print
this warning because it only has 73 reserve PEBs left?  (In which case
it seems fairly innocuous, right?)

>
> Yes. But in the log you sent I do not see any message about autoresize
> happening - UBI prints them.
>

Correct, this device was running for a while (several months) before
it started having problems.  I've never seen the warning printed on a
brand new device (which is the only time autoresize happens, right?),
but I've seen it on several that have been in operation for a while.

I just wanted to be sure that I'm using autoresize properly, and that
it's not somehow screwing up the # of reserved PEBs.  But it doesn't
seem like that's the case.  (Unless the sequence # or non-erased flash
are to blame - below).

>
> Does it erase whole flash before writing the image? I see that your
> image sequence number is 0, which means you probably use old ubi tools.
> Please, use the latest ubinize - it should pick random sequence number,
> or you may use -Q option.
>

I am using up to date mtd-utils now, but this device has been in the
field for months.  We were using a mtd-utils git snapshot from 4/29/09
to generate the UBI image.

I didn't know about the sequence number, I'll be sure we use an
updated mtd-utils for our next firmware version.

Could this account for the warning and/or the UBIFS error below?  Or
would these kinds of problems manifest in a different way entirely?

>
> When you see this warning, can you mount UBIFS? Does it look OK?
>

So far I've only noticed it on 3 devices.  All 3 had UBIFS errors
(below) later on in the boot process, which is what prompted me to
wonder what the warning meant.  I'm not entirely sure that the UBI
warning and UBIFS error are related, but so far I haven't noticed the
warning on any other devices.

>
> Can you please enable UBI debugging messages and also "Additional UBI
> initialization and build messages" and attach a log? See this writing
> for help: http://www.linux-mtd.infradead.org/faq/ubi.html#L_how_debug
>

Certainly.  I enabled all the relevant UBI and UBIFS debugging options
that I saw, along with internal self-checks, but there's still not a
whole lot of output.  Full console dump is attached - this is a
different device than the first, but exhibits the same problem.

Unfortunately I'm not yet sure what causes the devices to get into
this state, so I can't easily reproduce whatever makes it get into
this state in the first place.  However I own one of them and have it
at my desk, so I can perform any tests & gather any additional info
that would be helpful.

FYI, I did build & run all of the MTD test modules to prove out the
platform-level NAND code (MPC 8313), and encountered no problems.
However, that was on a different device (one that works fine), since
the nature of the tests means that I have to re-partition my flash so
that there's a spare MTD to work with.

Thanks!

-- 
Matthew L. Creech
-------------- next part --------------
Linux version 2.6.34 (mlcreech at px-build) (gcc version 4.4.4 (GCC) ) #2 Mon Jul 2
6 16:16:52 EDT 2010                                                             
bootconsole [udbg0] enabled                                                     
setup_arch: bootmem                                                             
mpc831x_rdb_setup_arch()                                                        
arch: exit                                                                      
Zone PFN ranges:                                                                
  DMA      0x00000000 -> 0x00008000                                             
  Normal   empty                                                                
Movable zone start PFN for each node                                            
early_node_map[1] active PFN ranges                                             
    0: 0x00000000 -> 0x00008000                                                 
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512      
Kernel command line: ubi.mtd=1 root=ubi0:container rw rootfstype=ubifs initlo=/r
ootfs1.img init=/linuxrc                                                        
PID hash table entries: 512 (order: -1, 2048 bytes)                             
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)                  
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)                    
Memory: 126412k/131072k available (3280k kernel code, 4660k reserved, 136k data,
 73k bss, 144k init) 
Kernel virtual memory layout:                                                   
  * 0xfffdf000..0xfffff000  : fixmap                                            
  * 0xfdffe000..0xfe000000  : early ioremap                                     
  * 0xc9000000..0xfdffe000  : vmalloc & ioremap                                 
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1         
Hierarchical RCU implementation.                                                
NR_IRQS:512 nr_irqs:512                                                         
IPIC (128 IRQ sources) at c9000700                                              
clocksource: timebase mult[f00000a] shift[22] registered                        
Mount-cache hash table entries: 512                                             
NET: Registered protocol family 16                                              
                                                                                
bio: create slab <bio-0> at 0                                                   
Freescale Elo / Elo Plus DMA driver                                             
Switching to clocksource timebase                                               
NET: Registered protocol family 2                                               
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)                  
TCP established hash table entries: 4096 (order: 3, 32768 bytes)                
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)                       
TCP: Hash tables configured (established 4096 bind 4096)                        
TCP reno registered                                                             
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)                         
NET: Registered protocol family 1                                               
WDT driver for MPC8xxx initialized. mode:reset timeout=65535 (64 seconds)       
fsl-elo-dma e00082a8.dma: #0 (fsl,elo-dma-channel), irq 71                      
fsl-elo-dma e00082a8.dma: #1 (fsl,elo-dma-channel), irq 71                      
fsl-elo-dma e00082a8.dma: #2 (fsl,elo-dma-channel), irq 71                      
fsl-elo-dma e00082a8.dma: #3 (fsl,elo-dma-channel), irq 71                      
squashfs: version 4.0 (2009/01/31) Phillip Lougher                              
Registering unionfs 2.5.4 (for 2.6.34-rc0)                                      
msgmni has been set to 246                                                      
alg: No test for stdrng (krng)                                                  
io scheduler noop registered                                                    
io scheduler deadline registered (default)                                      
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled                        
serial8250.0: ttyS0 at MMIO 0xe0004500 (irq = 16) is a 16550A                   
console [ttyS0] enabled, bootconsole disabled                                   
console [ttyS0] enabled, bootconsole disabled                                   
serial8250.0: ttyS1 at MMIO 0xe0004600 (irq = 17) is a 16550A                   
brd: module loaded                                                              
loop: module loaded                                                             
NAND device: Manufacturer ID: 0xec, Chip ID: 0xd3 (Samsung NAND 1GiB 3,3V 8-bit)
RedBoot partition parsing not available                                         
Creating 2 MTD partitions on "e2800000.flash":                                  
0x000000000000-0x000000500000 : "u-boot"
0x000000500000-0x000040000000 : "ubi"                                           
eLBC NAND device at 0xe2800000, bank 0                                          
UBI: attaching mtd1 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 warning: ubi_eba_init_scan: cannot reserve enough PEBs for bad PEB handling,
 reserved 73, need 81                                                           
UBI: attached mtd1 to ubi0                                                      
UBI: MTD device name:            "ubi"                                          
UBI: MTD device size:            1019 MiB                                       
UBI: number of good PEBs:        8136                                           
UBI: number of bad PEBs:         16                                             
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: 8136                                        
UBI: number of PEBs reserved for bad PEB handling: 73                           
UBI: max/mean erase counter: 316/49
UBI: image sequence number: 0                                                   
UBI: background thread "ubi_bgt0d" started, PID 196                             
Fixed MDIO Bus: probed                                                          
eth0: Gianfar Ethernet Controller Version 1.2, 00:e0:0c:00:95:01                
eth0: Running with NAPI enabled                                                 
eth0: RX BD ring size for Q[0]: 256                                             
eth0: TX BD ring size for Q[0]: 256                                             
Freescale PowerQUICC MII Bus: probed                                            
i2c /dev entries driver                                                         
nf_conntrack version 0.5.0 (1975 buckets, 7900 max)                             
ip_tables: (C) 2000-2006 Netfilter Core Team                                    
TCP cubic registered                                                            
NET: Registered protocol family 10                                              
ip6_tables: (C) 2000-2006 Netfilter Core Team                                   
IPv6 over IPv4 tunneling driver                                                 
NET: Registered protocol family 17                                              
UBIFS: recovery needed                                                          
UBIFS error (pid 1): ubifs_read_node: bad node type (255 but expected 9)        
UBIFS error (pid 1): ubifs_read_node: bad node at LEB 5586:110392               
Call Trace:                                                                     
[c7827cf0] [c00083f0] show_stack+0x7c/0x19c (unreliable)                        
[c7827d30] [c00e9fa8] ubifs_read_node+0x2f4/0x330                               
[c7827d60] [c010d0b0] ubifs_load_znode+0xe4/0x590                               
[c7827da0] [c010f9e0] dbg_walk_index+0x208/0x304
[c7827de0] [c010fb34] dbg_check_idx_size+0x58/0xe8                              
[c7827e10] [c00e6fa4] ubifs_get_sb+0xc90/0x1670                                 
[c7827ea0] [c0078954] vfs_kern_mount+0x74/0x108                                 
[c7827ed0] [c0078a44] do_kern_mount+0x4c/0x114                                  
[c7827f00] [c0091a2c] do_mount+0x68c/0x720                                      
[c7827f50] [c0091b60] sys_mount+0xa0/0xf8                                       
[c7827f80] [c0311154] mount_block_root+0x130/0x2dc                              
[c7827fd0] [c0311420] prepare_namespace+0xb0/0x204                              
[c7827fe0] [c0310268] kernel_init+0x148/0x168                                   
[c7827ff0] [c0010318] kernel_thread+0x4c/0x68                                   
UBIFS error (pid 1): dbg_check_idx_size: error -22 while walking the index      
List of all partitions:                                                         
1f00            5120 mtdblock0 (driver?)                                        
1f01         1043456 mtdblock1 (driver?)                                        
No filesystem could mount root, tried:  ubifs                                   
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)  
Call Trace:                                                                     
[c7827f00] [c00083f0] show_stack+0x7c/0x19c (unreliable)                        
[c7827f40] [c0281c2c] panic+0x94/0x108                                          
[c7827f80] [c03112c4] mount_block_root+0x2a0/0x2dc                              
[c7827fd0] [c0311420] prepare_namespace+0xb0/0x204                              
[c7827fe0] [c0310268] kernel_init+0x148/0x168                                   
[c7827ff0] [c0010318] kernel_thread+0x4c/0x68                                   
Rebooting in 180 seconds..


More information about the linux-mtd mailing list