[U-Boot] [PATCH] UBI: fix endless loop when a bitflip was detected

Holger Brunck holger.brunck at keymile.com
Wed Sep 21 11:08:58 CEST 2011


On 09/13/2011 11:07 AM, Holger Brunck wrote:
> On km_kirkwood boards we saw that u-boot gets stuck if the
> UBI layer detects a correctable bitflip in the NAND flash
> when u-boot tries to attach to the UBI device.
> 
> This was already fixed in the UBI layer in the current
> mainline linux. The original commit was:
> 
> "commit b86a2c56e512f46d140a4bcb4e35e8a7d4a99a4b
> Author: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
> Date:   Sun May 24 14:13:34 2009 +0300
> 
> UBI: do not switch to R/O mode on read errors
> 
> This patch improves UBI errors handling. ATM UBI switches to
> R/O mode when the WL worker fails to read the source PEB.
> This means that the upper layers (e.g., UBIFS) has no
> chances to unmap the erroneous PEB and fix the error.
> This patch changes this behaviour and makes UBI put PEBs
> like this into a separate RB-tree, thus preventing the
> WL worker from hitting the same read errors again and
> again.
> 
> But there is a 10% limit on a maximum amount of PEBs like this.
> If there are too much of them, UBI switches to R/O mode.
> 
> Additionally, this patch teaches UBI not to panic and
> switch to R/O mode if after a PEB has been copied, the
> target LEB cannot be read back. Instead, now UBI cancels
> the operation and schedules the target PEB for torturing.
> 
> The error paths has been tested by ingecting errors
> into 'ubi_eba_copy_leb()'."
> 
> This patch is the portation to u-boot with some changes. The
> constants for errors used in the original patch were replaced
> with numeric values as present in current ubi layer. The constant
> "MOVE_TARGET_RD_ERR" was removed from the original patch because
> the current u-boot version didn't evaluate this value.
> 
> Signed-off-by: Holger Brunck <holger.brunck at keymile.com>
> cc: Stefan Roese <sr at denx.de>
> ---
>  drivers/mtd/ubi/build.c |    9 +++++++++
>  drivers/mtd/ubi/eba.c   |    8 ++++++--
>  drivers/mtd/ubi/ubi.h   |   10 ++++++++--
>  drivers/mtd/ubi/wl.c    |   43 +++++++++++++++++++++++++++++++++++++------
>  4 files changed, 60 insertions(+), 10 deletions(-)
> 

please drop this patch. I was wrong, see:
http://lists.denx.de/pipermail/u-boot/2011-September/101887.html

Best regards
Holger


More information about the U-Boot mailing list