[U-Boot] Porting UBI fixes (specially fastmap's) to U-Boot

Heiko Schocher hs at denx.de
Thu Oct 8 14:51:23 CEST 2015


Hello Ezequiel, Richard,

Am 02.10.2015 um 18:27 schrieb Ezequiel Garcia:
> Hello Heiko,
>
> According to Richard Weinberger, UBI fastmap is broken in U-Boot.
> There are plenty
> of fixes in Linux that we should pull in U-Boot to fix it.
>
> Maybe you are already aware of this and you have some work-in-progress
> patches to share?
> Otherwise, I might be able to spend some time working on this in the next weeks.

I just tried to do this port ... but stumbled over some issues, I just try to
looking at ... but running out of time for doing more ...

- ubifastmap needs now scatterlist ... we have no support for this
   currently in U-Boot.

- I get some bogus compilerwarnings:

   CC      drivers/mtd/ubi/fastmap-wl.o
drivers/mtd/ubi/fastmap-wl.c:69:3: warning: implicit declaration of function 'wl_tree_add' 
[-Wimplicit-function-declaration]

wl_tree_add is declared static here:
http://lxr.free-electrons.com/source/drivers/mtd/ubi/wl.c#L152

but called from fastmap-wl.c
http://lxr.free-electrons.com/source/drivers/mtd/ubi/fastmap-wl.c#L64

same for:
find_mean_wl_entry
self_check_in_wl_tree
wl_get_wle
find_wl_entry
prot_queue_add
schedule_ubi_work
schedule_erase

drivers/mtd/ubi/fastmap-wl.c: In function 'ubi_is_erase_work':
drivers/mtd/ubi/fastmap-wl.c:340:1: warning: control reaches end of non-void function [-Wreturn-type]

:-(

Does this warnings not occur when compiling linux with fastmap support?

I used as base for porting ubi/ubifs from linux:

    commit 64291f7db5bd8150a74ad2036f1037e6a0428df2
     Author: Linus Torvalds <torvalds at linux-foundation.org>
     Date:   Sun Aug 30 11:34:09 2015 -0700

         Linux 4.2


@Richard: a first change for U-Boot wish:

You used here and there sometimes "free" as an variable name ... for example:
in "drivers/mtd/ubi/fastmap.c"

static int scan_pool(struct ubi_device *ubi, struct ubi_attach_info *ai,
                      int *pebs, int pool_size, unsigned long long *max_sqnum,
                      struct list_head *free)

compiling this under U-Boot drops:

   CC      drivers/mtd/ubi/fastmap.o
drivers/mtd/ubi/fastmap.c: In function 'scan_pool':
drivers/mtd/ubi/fastmap.c:475:3: error: called object 'free' is not a function

(line number differs from mainline, because I added some U-Boot specific
  line above)

Could we rename this var to something else ... like for example "pfree" ?
I can prepare a patch for linux, if this would be Ok for you.

bye,
Heiko
-- 
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