]> err.no Git - linux-2.6/commitdiff
UBI: rework scrubbing messages
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 18 Jul 2008 09:20:23 +0000 (12:20 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Thu, 24 Jul 2008 10:34:46 +0000 (13:34 +0300)
If bit-flips happen often, UBI prints to many messages. Lessen
the amount by only printing the messages when the PEB has been
scrubbed. Also, print torturing messages.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
drivers/mtd/ubi/io.c
drivers/mtd/ubi/wl.c

index 27b9c2c2fc60de368c5f4dff81270fe18f309290..2bebb39d19b3bf7717ec108a2239ef2bd966cd88 100644 (file)
@@ -156,8 +156,12 @@ retry:
                        /*
                         * -EUCLEAN is reported if there was a bit-flip which
                         * was corrected, so this is harmless.
+                        *
+                        * We do not report about it here unless debugging is
+                        * enabled. A corresponding message will be printed
+                        * later, when it is has been scrubbed.
                         */
-                       ubi_msg("fixable bit-flip detected at PEB %d", pnum);
+                       dbg_msg("fixable bit-flip detected at PEB %d", pnum);
                        ubi_assert(len == read);
                        return UBI_IO_BITFLIPS;
                }
@@ -391,6 +395,7 @@ static int torture_peb(struct ubi_device *ubi, int pnum)
 {
        int err, i, patt_count;
 
+       ubi_msg("run torture test for PEB %d", pnum);
        patt_count = ARRAY_SIZE(patterns);
        ubi_assert(patt_count > 0);
 
@@ -434,6 +439,7 @@ static int torture_peb(struct ubi_device *ubi, int pnum)
        }
 
        err = patt_count;
+       ubi_msg("PEB %d passed torture test, do not mark it a bad", pnum);
 
 out:
        mutex_unlock(&ubi->buf_mutex);
index 761952ba125b216c8ba8fba77348b6dd2d9ea6ec..6821952bcdb8d399db2aea069a1c7c4ff0dea6a5 100644 (file)
@@ -873,6 +873,10 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk,
        }
 
        ubi_free_vid_hdr(ubi, vid_hdr);
+       if (scrubbing && !protect)
+               ubi_msg("scrubbed PEB %d, data moved to PEB %d",
+                       e1->pnum, e2->pnum);
+
        spin_lock(&ubi->wl_lock);
        if (protect)
                prot_tree_add(ubi, e1, pe, protect);
@@ -1231,7 +1235,7 @@ int ubi_wl_scrub_peb(struct ubi_device *ubi, int pnum)
 {
        struct ubi_wl_entry *e;
 
-       ubi_msg("schedule PEB %d for scrubbing", pnum);
+       dbg_msg("schedule PEB %d for scrubbing", pnum);
 
 retry:
        spin_lock(&ubi->wl_lock);