UBI: Ensure that "background thread" operations are really executed
authorStefan Roese <sr@denx.de>
Mon, 17 May 2010 08:00:51 +0000 (10:00 +0200)
committerStefan Roese <sr@denx.de>
Wed, 19 May 2010 08:57:19 +0000 (10:57 +0200)
The current U-Boot UBI implementation is copied from Linux. In this
porting the UBI background thread was not handled correctly. Upon write
operations ubi_wl_flush() makes sure, that all queued operations, like
page-erase, are completed. But this is missing for read operations.

This patch now makes sure that such operations (like scrubbing upon
bit-flip errors) are not queued, but executed directly.

Signed-off-by: Stefan Roese <sr@denx.de>
drivers/mtd/ubi/wl.c

index 2f9a5e3653e024012ea21a892afa494e5a7f4a86..88b867a0c173a754a7a173e70a736ca08bb87014 100644 (file)
@@ -696,8 +696,13 @@ static void schedule_ubi_work(struct ubi_device *ubi, struct ubi_work *wrk)
        list_add_tail(&wrk->list, &ubi->works);
        ubi_assert(ubi->works_count >= 0);
        ubi->works_count += 1;
-       if (ubi->thread_enabled)
-               wake_up_process(ubi->bgt_thread);
+
+       /*
+        * U-Boot special: We have no bgt_thread in U-Boot!
+        * So just call do_work() here directly.
+        */
+       do_work(ubi);
+
        spin_unlock(&ubi->wl_lock);
 }