From: Mike Dunn <mikedunn@newsguy.com>
To: dedekind1@gmail.com
Cc: Ivan Djelic <ivan.djelic@parrot.com>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: ubi on MLC nand flash
Date: Tue, 08 Nov 2011 19:04:23 -0800 [thread overview]
Message-ID: <4EB9EDB7.7000600@newsguy.com> (raw)
In-Reply-To: <1320788720.17770.43.camel@koala>
On 11/08/2011 01:45 PM, Artem Bityutskiy wrote:
> On Sun, 2011-11-06 at 12:28 -0800, Mike Dunn wrote:
>>> I suggest the following strategy:
>>>
>>> Upon reading, when errors are detected (and corrected by ecc):
>>> - if (nb of errors < ecc capability (*)) then no scrubbing, do nothing
>>> - if (nb of errors == ecc capability (*)) then
>>> - scrub block, then torture it and compute nb of persistent bitflips
>>> - if (nb of persistent errors < ecc capability (*)) then block is OK
>>> - if (nb of persistent errors == ecc capability (*)) then mark block as bad
>>> [because a single additional bitflip (e.g. a read disturb) would cause
>>> data loss]
>>>
>>> (*) In order to improve reliability, thresholds can be used instead of max ecc
>>> capability.
>>
>> One wrinkle is that the torture test is performed over the entire erase block,
>> not just the page(s) with the correctible error(s). So the biflip stats are
>> cumulative over the entire block, and may not even occur on the same page. The
>> current UBI policy for the torture test is that *any* bitflips on *any* page
>> following the erasure causes the block to be marked bad.
>>
>> Another complication is that there's currently no way to accurately determine in
>> the UBI code the number of bitflips the read operation caused. Currently the
>> occurrence of bitflips (one or more) is determined by the return code from the
>> mtd subsystem, which has exclusive access to the device during the read
>> operation. Just checking the ecc_stats field in the mtd_info structure could
>> include errors in read operations performed by other processes.
> What about something like this.
>
> 1. MTD knows flash's ECC strength (driver sets it)
> 2. MTD sets the scrub level = ECC strength by default
> 3. MTD can expose the scrub level and ECC strength via sysfs and make
> the scrub level sysfs file writable, so the user can vary it between
> 1 and ECC strength.
> 4. MTD just does not report -EUCEAN if the ECC correction order is
> less than the scrub level.
>
> Then you do not need to change UBI at all.
That sounds reasonable, but the changes seem broadly consequential.
> WRT blank pages, I guess MTD can gain some internal smartness as well -
> the driver can report to the NAND base that a blank page was read, and
> the ECC correction order, then NAND base will make the decision about
> reporting -EUCLEAN and setting the buffer to all 0xFFs.
I haven't yet surveyed the other drivers regarding ecc and blank page reading.
I assumed that ecc was disregarded for blank pages, but probably some drivers
are more thoughtful about it than I originally was.
> Also, it sounds like this may require re-working the current MTD
> interface and turn all these function pointers (mtd->read(), etc) into
> normal functions (mtd_read()) which will allow inserting additional
> logic at various levels.
Oofa. What have I gotten myself into? I don't have all those devices on which
to test the changes, and I'd hate to break a driver. But you're right. Both
mtd and nand interfaces would have to change to provide a mechanism for
returning an error count (corrected or uncorrected) to some
yet-to-be-implemented mtd infrastructure code. Drivers that don't use the NAND
interface currently return -EUCLEAN directly to the higher layer (e.g. UBI).
For drivers using the nand interface, nand_base.c handles it.
> WRT ecc_stats - IMHO, it is useless and rudimentary thing and could be
> just killed...
Some userspace mtd-utils for nand currently use it, though.
I'm able to at least look into making these changes if you want to go ahead. My
motivation is to get a robust ubifs on my diskonchip G4.
Thanks,
Mike
next prev parent reply other threads:[~2011-11-09 2:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-06 15:24 ubi on MLC nand flash Mike Dunn
2011-11-06 17:35 ` Ivan Djelic
2011-11-06 20:28 ` Mike Dunn
2011-11-08 21:45 ` Artem Bityutskiy
2011-11-09 3:04 ` Mike Dunn [this message]
2011-11-09 8:44 ` Artem Bityutskiy
2011-11-09 13:13 ` Mike Dunn
2011-11-09 12:22 ` Artem Bityutskiy
2011-11-08 21:32 ` Artem Bityutskiy
2011-11-09 1:51 ` Mike Dunn
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=4EB9EDB7.7000600@newsguy.com \
--to=mikedunn@newsguy.com \
--cc=dedekind1@gmail.com \
--cc=ivan.djelic@parrot.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.