From: Mike Dunn <mikedunn@newsguy.com>
To: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: dedekind1@gmail.com, David Woodhouse <dwmw2@infradead.org>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
Ivan Djelic <ivan.djelic@parrot.com>
Subject: Re: [PATCH v2 07/16] mtd/docg3: add OOB layout to mtdinfo
Date: Sun, 13 Nov 2011 11:55:14 -0800 [thread overview]
Message-ID: <4EC020A2.9070003@newsguy.com> (raw)
In-Reply-To: <87ehxchta0.fsf@free.fr>
On 11/13/2011 08:38 AM, Robert Jarzmik wrote:
>
> And while we're discussing MTD API, I'd like to add another thing I was thinking
> of, from a conversation Mike and Ivan had.
>
> They discussed how UBIFS is "intolerant" to bitflips, and marks a block as
> "unusable" if one bitflip occured, even if the ECC can fix much more.
>
> What I was thinking is that the MTD oob information which exposes how many ECC
> are available should expose as well how many bitflips can be fixed (for example
> 4 bitflips can be fixed, 5 bitflips can be detected).
You're referring to struct nand_ecclayout? I wouldn't think that would be the
appropriate place; it just describes the layout, not operational details.
> Then, the read_oob()
> function could return back 0 if read was successful, -Exxxx on error, or a
> positive number N if N bitflips were fixed.
> With this information, upper level could decide from (read_oob() return and
> ecc.fixable_bitflips) if a block should be marked as unusable (worn out) or not.
Something along these lines was suggested by Artem a few days ago:
http://lists.infradead.org/pipermail/linux-mtd/2011-November/038376.html
I'm looking into implementing this. Currently the drivers return -EUCLEAN from
read() and read_oob() if *any* bit error corrections were made, and this is the
information used by ubi to determine whether to scrub, and also whether to mark
a block as "bad" after running the PEB torture test. To summarize Artem's
suggestion in my own words... The drivers expose the ecc strength to the mtd
subsystem (as Robert also suggests). Mtd assigns a "scrublevel" to the device,
settable by the user through sysfs, with ecc strength as the default. Read
operations no longer go directly to the driver (as they currently do for
unpartitioned devices) but are handled in mtd. The driver returns the corrected
error count to mtd, which makes the determination of whether to return -EUCLEAN
or 0, based on the number of corrected errors and the scrublevel.
An objection might be that mtd should not be setting policy. It's also a fairly
sizeable modification. The alternative would be to implement a mechanism to
return the corrected error count to the higher layer (e.g., ubi) for each read
operation. This would be even more work, requiring modifications to mtd and ubi.
I'd like to work to resolve this either way, as ubi and ubifs are the killer
apps for these new drivers.
Thanks,
Mike
next prev parent reply other threads:[~2011-11-13 18:56 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-10 8:05 [PATCH v2 00/16] DocG3 fixes and write support Robert Jarzmik
2011-11-10 8:05 ` [PATCH v2 01/16] mtd/docg3: fix debug log verbosity Robert Jarzmik
2011-11-10 8:05 ` [PATCH v2 02/16] mtd/docg3: fix tracing of IO in writeb Robert Jarzmik
2011-11-10 8:05 ` [PATCH v2 03/16] mtd/docg3: fix protection areas reading Robert Jarzmik
2011-11-10 8:05 ` [PATCH v2 04/16] mtd/docg3: fix BCH registers Robert Jarzmik
2011-11-12 19:40 ` Mike Dunn
2011-11-13 10:20 ` Robert Jarzmik
2011-11-10 8:05 ` [PATCH v2 05/16] mtd/docg3: fix reading oob+data without correction Robert Jarzmik
2011-11-10 8:05 ` [PATCH v2 06/16] mtd/docg3: add multiple floor support Robert Jarzmik
2011-11-10 8:05 ` [PATCH v2 07/16] mtd/docg3: add OOB layout to mtdinfo Robert Jarzmik
2011-11-12 19:39 ` Mike Dunn
2011-11-13 10:18 ` Robert Jarzmik
2011-11-13 12:53 ` Artem Bityutskiy
2011-11-13 13:03 ` David Woodhouse
2011-11-13 13:35 ` Artem Bityutskiy
2011-11-13 16:38 ` Robert Jarzmik
2011-11-13 19:55 ` Mike Dunn [this message]
2011-11-13 20:27 ` Artem Bityutskiy
2011-11-14 18:08 ` Proposed change to mtd read functions (Was Re: [PATCH v2 07/16] mtd/docg3: add OOB layout to mtdinfo) Mike Dunn
2011-11-14 17:38 ` Artem Bityutskiy
2011-11-14 0:58 ` [PATCH v2 07/16] mtd/docg3: add OOB layout to mtdinfo Mike Dunn
2011-11-10 8:05 ` [PATCH v2 08/16] mtd/docg3: add registers for erasing and writing Robert Jarzmik
2011-11-10 8:05 ` [PATCH v2 09/16] mtd/docg3: add OOB buffer to device structure Robert Jarzmik
2011-11-10 8:05 ` [PATCH v2 10/16] mtd/docg3: add write functions Robert Jarzmik
2011-11-10 8:05 ` [PATCH v2 11/16] mtd/docg3: add erase functions Robert Jarzmik
2011-11-10 8:05 ` [PATCH v2 12/16] mtd/docg3: map erase and write functions Robert Jarzmik
2011-11-10 8:05 ` [PATCH v2 13/16] mtd/docg3: add ECC correction code Robert Jarzmik
2011-11-12 19:49 ` Mike Dunn
2011-11-13 10:35 ` Robert Jarzmik
2011-11-14 2:13 ` Mike Dunn
2011-11-10 8:05 ` [PATCH v2 14/16] mtd/docg3: add suspend and resume Robert Jarzmik
2011-11-10 8:05 ` [PATCH v2 15/16] mtd/docg3: add fast mode Robert Jarzmik
2011-11-10 8:05 ` [PATCH v2 16/16] mtd/docg3: add protection areas sysfs access Robert Jarzmik
2011-11-12 20:02 ` [PATCH v2 00/16] DocG3 fixes and write support Mike Dunn
2011-11-13 10:41 ` Robert Jarzmik
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=4EC020A2.9070003@newsguy.com \
--to=mikedunn@newsguy.com \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=ivan.djelic@parrot.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=robert.jarzmik@free.fr \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox