[U-Boot] Possible incoherence in UBI attaching, incorrect bad PEBs

Heiko Schocher hs at denx.de
Fri Jun 12 07:27:17 CEST 2015


Hello Walter,

Am 11.06.2015 19:04, schrieb Walter Mollica:
> Hi everyone,
> I am writing to get some information about what seems to be an incongruency
> in the U-Boot's UBI subsystem.
>
> I am using U-Boot 2015.04/2015.01 (haven't tried with previous versions),
> cloned today from the git tree on denx.de, on a SAMA5D3XEK hardware with a
> NAND Flash.
>
> There's a newly flashed UBI image on the NAND.
>
> When attaching the mtd partition in U-boot I get the following result:
> U-Boot> ubi part ubivolume
> UBI: attaching mtd1 to ubi0
> UBI: scanning is finished
> UBI: attached mtd1 (name "mtd=8", size 232 MiB) to ubi0
> UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
> UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
> UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
> UBI: good PEBs: 1862, bad PEBs: 0, corrupted PEBs: 0
> UBI: user volume: 3, internal volumes: 1, max. volumes count: 128
> UBI: max/mean erase counter: 2/0, WL threshold: 4096, image sequence
> number: 1307283568
> UBI: available PEBs: 1247, total reserved PEBs: 615, PEBs reserved for bad
> PEB handling: 40
>
> While, when doing the same (at boot time) from my GNU/Linux system
> (Buildroot'ed 3.10.0 on initramfs) I get:
> UBI: scanning is finished
> UBI: attached mtd8 (name "ubivolume", size 232 MiB) to ubi0
> UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
> UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
> UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
> UBI: good PEBs: 1858, bad PEBs: 4, corrupted PEBs: 0
> UBI: user volume: 3, internal volumes: 1, max. volumes count: 128
> UBI: max/mean erase counter: 0/0, WL threshold: 4096, image sequence
> number: 1307283568
> UBI: available PEBs: 1247, total reserved PEBs: 611, PEBs reserved for bad
> PEB handling: 36
>
> The max/mean erase counter are different as you can see, but there is
> another thing that scares me more.
>
> These two lines are *different*
> In U-Boot
> UBI: good PEBs: 1862, bad PEBs: 0, corrupted PEBs: 0
> in Linux
> UBI: good PEBs: 1858, bad PEBs: 4, corrupted PEBs: 0
>
> 4 PEBs which Linux's UBI marks as bad are seen as good from U-Boot.
 >
> Moreover, this 4 PEBs seem to have migrated into this other line (the last
> one):
> In U-Boot:
> UBI: available PEBs: 1247, total reserved PEBs: 615, PEBs reserved for bad
> PEB handling: 40
> In Linux:
> UBI: available PEBs: 1247, total reserved PEBs: 611, PEBs reserved for bad
> PEB handling: 36
>
> As you can see the reserved PEBs for bad PEB handling in U-Boot are 4+ in
> respect to the number reported by Linux.

Hmm.. hard to say, why this is diffrent ... We use UBI Code from
Linux 3.15 ... so the "UBI" behaviour should be the same

I tend to say, you have problems with detecting Bad Blocks on your
nand / nand driver problem ...

>>From what you know, is this to be considered some kind of "expected
> behaviour", misconfiguration or there's a problem to be fixed?
>
> As some UBI volumes will be written by both U-Boot and Linux, I am
> concerned about this issue. And it would be interesting to discover who's
> right between U-Boot and Linux.

Yes, that would be interesting, maybe both UBI are right, if your
nand driver (U-Boot or Linux) has problems ...

bye,
Heiko
>
> Thank you.
>
> Saluti,
> Walter Mollica
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


More information about the U-Boot mailing list