public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Question about the 2-bit EDC scrubbing at UBI
@ 2008-05-20  1:49 Kyungmin Park
  2008-05-20  5:15 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Kyungmin Park @ 2008-05-20  1:49 UTC (permalink / raw)
  To: Artem Bityutskiy, Adrian Hunter; +Cc: linux-mtd@lists.infradead.org

Hi,

In internal layout handling in UBI, it plans to scrub the LEB if the
2-bit EDC is found.
As you know, if the EDC is detected it can't trust which bit is wrong.
So it needs another handling.
But the code does as 1-bit ECC.

How do you think? Is that make a problem in use?

static struct ubi_vtbl_record *process_lvol(struct ubi_device *ubi,
                                            struct ubi_scan_info *si,
                                            struct ubi_scan_volume *sv)
{
        ...snip...
        dbg_msg("check layout volume");

        /* Read both LEB 0 and LEB 1 into memory */
        ubi_rb_for_each_entry(rb, seb, &sv->root, u.rb) {
                leb[seb->lnum] = vmalloc(ubi->vtbl_size);
                if (!leb[seb->lnum]) {
                        err = -ENOMEM;
                        goto out_free;
                }
                memset(leb[seb->lnum], 0, ubi->vtbl_size);

                err = ubi_io_read_data(ubi, leb[seb->lnum], seb->pnum, 0,
                                       ubi->vtbl_size);
                /* It has to check only 1-bit ECC not 2-bit EDC */
                if (err == UBI_IO_BITFLIPS || err == -EBADMSG) =>
should be 'if (err == UBI_IO_BITFLIPS)'
                        /* Scrub the PEB later */
                        seb->scrub = 1;
                else if (err)
                        goto out_free;
        }
        ...snip...
}

Thank you,
Kyungmin Park

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Question about the 2-bit EDC scrubbing at UBI
  2008-05-20  1:49 Question about the 2-bit EDC scrubbing at UBI Kyungmin Park
@ 2008-05-20  5:15 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2008-05-20  5:15 UTC (permalink / raw)
  To: Kyungmin Park; +Cc: linux-mtd@lists.infradead.org, Adrian Hunter

Hi Kyungmin,

Kyungmin Park wrote:
> In internal layout handling in UBI, it plans to scrub the LEB if the
> 2-bit EDC is found.
> As you know, if the EDC is detected it can't trust which bit is wrong.
> So it needs another handling.
> But the code does as 1-bit ECC.
> 
> How do you think? Is that make a problem in use?

Hi, I think the code is OK. I've added an explanatory comment
below.

BTW, have you received a lengthy description about our OneNAND
read error occasion from Adrian which he sent probably about 3
weeks ago?

>From 6a1384fa8e384110cfb761aa5c25511fc8ae812e Mon Sep 17 00:00:00 2001
From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Date: Tue, 20 May 2008 09:54:02 +0300
Subject: [PATCH] UBI: add a comment

It is not clear why we schedule PEB for scrubbing in case of
-EBADMSG. Elaborate.

Requested-by: Kyungmin Park <kmpark@infradead.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
 drivers/mtd/ubi/vtbl.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c
index 3c4d68f..42a7815 100644
--- a/drivers/mtd/ubi/vtbl.c
+++ b/drivers/mtd/ubi/vtbl.c
@@ -385,7 +385,16 @@ static struct ubi_vtbl_record *process_lvol(struct ubi_device *ubi,
 		err = ubi_io_read_data(ubi, leb[seb->lnum], seb->pnum, 0,
 				       ubi->vtbl_size);
 		if (err == UBI_IO_BITFLIPS || err == -EBADMSG)
-			/* Scrub the PEB later */
+			/*
+			 * Scrub the PEB later. Note, -EBADMSG indicates an
+			 * uncorrectable ECC error, but we have our own CRC and
+			 * the data will be checked later. If the data is OK,
+			 * the PEB will be scrubbed (because we set
+			 * seb->scrub). If the data is not OK, the contents of
+			 * the PEB will be recovered from the second copy, and
+			 * seb->scrub will be cleared in
+			 * 'ubi_scan_add_used()'.
+			 */
 			seb->scrub = 1;
 		else if (err)
 			goto out_free;
-- 
1.5.4.1


-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-20  5:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-20  1:49 Question about the 2-bit EDC scrubbing at UBI Kyungmin Park
2008-05-20  5:15 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox