Message ID | 55C3A465.5070504@nod.at |
---|---|
State | Not Applicable |
Delegated to: | Richard Weinberger |
Headers | show |
On Do, 2015-08-06 at 20:16 +0200, Richard Weinberger wrote: > Am 06.08.2015 um 10:10 schrieb Jörg Krause: > > I will turn fastmap off for now, but feel free to send more patches > > to > > try. > > Can you please give the attached patch a try? > Congratulations! That fix it :-) Here is the corresponding snap from the kernel log: [ 3.175194] ubi1: default fastmap pool size: 10 [ 3.179937] ubi1: default fastmap WL pool size: 5 [ 3.184713] ubi1: attaching mtd7 [ 3.539869] ubi1: scanning is finished [ 3.623707] ubi1: volume 0 ("user") re-sized from 13 to 262 LEBs [ 3.634937] ubi1: attached mtd7 (name "data", size 36 MiB) [ 3.640722] ubi1: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes [ 3.647772] ubi1: min./max. I/O unit sizes: 2048/2048, sub-page size 2048 [ 3.654611] ubi1: VID header offset: 2048 (aligned 2048), data offset: 4096 [ 3.661714] ubi1: good PEBs: 288, bad PEBs: 0, corrupted PEBs: 0 [ 3.667890] ubi1: user volume: 1, internal volumes: 1, max. volumes count: 128 [ 3.675168] ubi1: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1059544151 [ 3.684448] ubi1: available PEBs: 0, total reserved PEBs: 288, PEBs reserved for bad PEB handling: 20 [ 3.693923] ubi1: background thread "ubi_bgt1d" started, PID 42 Many thanks for this! Jörg
diff --git a/drivers/mtd/ubi/fastmap-wl.c b/drivers/mtd/ubi/fastmap-wl.c index b2a6653..bbd30dc 100644 --- a/drivers/mtd/ubi/fastmap-wl.c +++ b/drivers/mtd/ubi/fastmap-wl.c @@ -172,6 +172,30 @@ void ubi_refill_pools(struct ubi_device *ubi) } /** + * produce_free_peb - produce a free physical eraseblock. + * @ubi: UBI device description object + * + * This function tries to make a free PEB by means of synchronous execution of + * pending works. This may be needed if, for example the background thread is + * disabled. Returns zero in case of success and a negative error code in case + * of failure. + */ +static int produce_free_peb(struct ubi_device *ubi) +{ + int err; + + while (!ubi->free.rb_node && ubi->works_count) { + dbg_wl("do one work synchronously"); + err = do_work(ubi); + + if (err) + return err; + } + + return 0; +} + +/** * ubi_wl_get_peb - get a physical eraseblock. * @ubi: UBI device description object * @@ -213,6 +237,7 @@ again: } retried = 1; up_read(&ubi->fm_eba_sem); + produce_free_peb(ubi); goto again; }