All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gideon <gideonda32@gmail.com>
To: linux-mtd@lists.infradead.org
Subject: Question about scrubbing and ECC errors (in UBI)
Date: Fri, 21 Jul 2023 11:55:40 +1000	[thread overview]
Message-ID: <CAOLMD=zkVT=OOMeGG-hrT=BQqog=YDDHdyfhPi_ELwDjEOoBoQ@mail.gmail.com> (raw)

Hi,

I have a general question about how ECC errors are handled in
drivers/mtd/ubi/eba.c.  I am using a Micron raw NAND part with on-die
ECC and an ECC strength of 4 bits.

I simulated an ECC error via some error injection code, to see whether
or not the UBI layer would mark it for scrubbing.  But I saw that UBI
didn't want to mark it for scrubbing, due to it being a UBI dynamic
volume.  Here's the relevant code (which seems to have been around
since 2006, and still exists on 6.x-series kernels).

I'm just wondering; what is the motivation/reasoning behind only
setting 'scrub = 1' (and scrubbing) if it is _not_ a dynamic volume?
Why only scrub if it's a static volume?  I would have thought that
scrubbing a PEB would be beneficial in all cases that an ECC error
occurred.

err = ubi_io_read_data(ubi, buf, pnum, offset, len);
if (err) {
    if (err == UBI_IO_BITFLIPS)
        scrub = 1;
    else if (mtd_is_eccerr(err)) {
        if (vol->vol_type == UBI_DYNAMIC_VOLUME)
            goto out_unlock;
        scrub = 1;
        if (!check) {
            ubi_msg(ubi, "force data checking");
            check = 1;
            goto retry;
        }
    } else
        goto out_unlock;
}

Thanks!
- DG

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

                 reply	other threads:[~2023-07-21  2:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOLMD=zkVT=OOMeGG-hrT=BQqog=YDDHdyfhPi_ELwDjEOoBoQ@mail.gmail.com' \
    --to=gideonda32@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.