From: Mike Dunn <mikedunn@newsguy.com>
To: Matthieu CASTET <matthieu.castet@parrot.com>
Cc: Ivan Djelic <ivan.djelic@parrot.com>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH v2] mtd: nand: Add driver for M-sys / Sandisk diskonchip G4
Date: Fri, 04 Nov 2011 07:20:26 -0700 [thread overview]
Message-ID: <4EB3F4AA.8090703@newsguy.com> (raw)
In-Reply-To: <4EB25B62.4070502@parrot.com>
On 11/03/2011 02:14 AM, Matthieu CASTET wrote:
> Hi,
>
> Ivan Djelic a écrit :
>>
>> 1. When you program a page, before writing hwecc to oob, adjust it like this:
>>
>> hwecc[i] ^= blank_read_hwecc[i]^0xff;
>>
>> The effect of this is that you now get 0xffs as ecc for blank pages, and bitflip
>> correction on erased pages for free. This is transparent to your controller,
>> because this "adjustment" cancels itself upon reading when calc_ecc^recv_ecc is
>> computed.
Not entirely transparent. I didn't think this through. Modifying the
hw-generated ecc bytes causes the hw to think that there were error(s) on every
page. True, the driver will know better, but it will slow things down because
ordinarily the ecc unit only has to be read when the hardware reports errors.
With this scheme, an error is reported and the ecc bytes read and processed on
every page.
>> 2. Use unprotected spare oob byte 15 as a programmming marker: remove it from
>> the oob_free list, and force it to 0 when you program a page. Now, you can
>> easily detect if a page is blank or has been programmed by checking this byte.
>> You can for instance count the number of bits set to 1 in the byte, and decide
>> it is blank if that number is greater than 4; this ensures you are robust to
>> bitflips in the marker byte itself.
>>
>> My preference would go to option 2 in your case.
>>
I'm going to implement option 2 for now...
> Note that UBIFS except blank page to be 0xff.
>
> With option 1 you have nothing to do (ecc correct bit-flips), with option 2 you
> have to memset the page (data+spare) to 0xff to clear bit-flips.
>
> Also with option 2 you don't know how many bit-flip there are in the blank page.
> Because UBIFS (or mtd) don't check the page after a write , you can end writting
> a page with too many bit-flips without any error.
...keeping these things in mind during testing. A warning is printedto the
kernel log when a bank page is read with errors. If I see this occurring, maybe
the performance hit of option 1 is warranted.
Thanks again gentlemen.
Mike
next prev parent reply other threads:[~2011-11-04 14:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-02 23:00 [PATCH v2] mtd: nand: Add driver for M-sys / Sandisk diskonchip G4 Mike Dunn
2011-11-03 8:58 ` Ivan Djelic
2011-11-03 9:14 ` Matthieu CASTET
2011-11-03 16:55 ` Mike Dunn
2011-11-04 14:20 ` Mike Dunn [this message]
2011-11-04 15:23 ` Ivan Djelic
2011-11-04 16:58 ` Ivan Djelic
2011-11-04 20:34 ` Mike Dunn
2011-11-03 16:54 ` Mike Dunn
2011-11-03 17:52 ` Mike Dunn
[not found] <1388924089.4520961320317174391.JavaMail.root@zimbra20-e3.priv.proxad.net>
2011-11-03 11:02 ` Robert Jarzmik
2011-11-03 11:59 ` Ivan Djelic
2011-11-08 21:12 ` Artem Bityutskiy
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=4EB3F4AA.8090703@newsguy.com \
--to=mikedunn@newsguy.com \
--cc=ivan.djelic@parrot.com \
--cc=linux-mtd@lists.infradead.org \
--cc=matthieu.castet@parrot.com \
/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.