• Heiko Schocher's avatar
    mtd, ubi: set free_count to zero before walking through erase list · 68fc4490
    Heiko Schocher authored
    Set free_count to zero before walking through ai->erase list
    in wl_init().
    
    As U-Boot has no workqueue/threads, it immediately calls
    erase_worker(), which increase for each erased block
    free_count. Without this patch, free_count gets after
    this initialized to zero in wl_init(), so the free_count
    variable always has the maybe wrong value 0.
    
    Detected this behaviour on the dxr2 board, where the
    UBI fastmap gets not written when attaching/dettaching
    on an empty NAND. It drops instead the error message:
    
    could not find any anchor PEB
    
    With this patch, fastmap gets written on dettach.
    Signed-off-by: default avatarHeiko Schocher <hs@denx.de>
    Reviewed-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
    68fc4490
Name
Last commit
Last update
Licenses Loading commit data...
api Loading commit data...
arch Loading commit data...
board Loading commit data...
cmd Loading commit data...
common Loading commit data...
configs Loading commit data...
disk Loading commit data...
doc Loading commit data...
drivers Loading commit data...
dts Loading commit data...
examples Loading commit data...
fs Loading commit data...
include Loading commit data...
lib Loading commit data...
net Loading commit data...
post Loading commit data...
scripts Loading commit data...
test Loading commit data...
tools Loading commit data...
.checkpatch.conf Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
Kbuild Loading commit data...
Kconfig Loading commit data...
MAINTAINERS Loading commit data...
MAKEALL Loading commit data...
Makefile Loading commit data...
README Loading commit data...
config.mk Loading commit data...
snapshot.commit Loading commit data...