From: Artem Bityutskiy <dedekind1@gmail.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>,
Mike Dunn <mikedunn@newsguy.com>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 07/16] mtd/docg3: add OOB layout to mtdinfo
Date: Sun, 13 Nov 2011 15:35:49 +0200 [thread overview]
Message-ID: <1321191352.2273.14.camel@koala> (raw)
In-Reply-To: <1321189398.2021.5.camel@shinybook.infradead.org>
On Sun, 2011-11-13 at 13:03 +0000, David Woodhouse wrote:
> On Sun, 2011-11-13 at 14:53 +0200, Artem Bityutskiy wrote:
> > On Sun, 2011-11-13 at 11:18 +0100, Robert Jarzmik wrote:
> > > I personally think this should be provided by the MTD API. A function
> > > is_page_blank(ofs) could tell if the page was written or not. Now if the
> > > function is NULL, the upper layer (UBIFS, ...) could decide _by itself_ to
> > > assign a free OOB byte to that meaning. But IMHO it's not the drivers duty to
> > > take these decisions to restrict the OOB, let it be done at an upper level.
> >
> > Probably it is a good idea to introduce an mtd_is_page_blank. But it
> > should either work for all flashes or not introduced at all. I do not
> > think upper layers should use OOB at all. And this interface should also
> > work for NOR flash. Probably it should just fall-back to comparing the
> > data with 0xFF if the driver cannot offer anything special.
>
> We *tried* comparing with 0xFF in JFFS2 and found that it wasn't good
> enough (it could be *mostly* erased before a powerfail but not
> completely, so as soon as you start to program it you get a lot of
> bitflips). Hence the cleanmarkers.
>
> The only way you can treat a page as erased is if you *know* it was
> successfully erased. So I'd be reluctant to introduce a function that
> encourages people to draw inferences they shouldn't.
That's a bit different. Nowadays no one tries to compare to 0xFFs to
check if an eraseblock is erased or not :-)
This is about the situation when you have an eraseblock with data, and
you want to find where it ends, e.g., you want to find the first blank
NAND page. Both JFFS2 and UBIFS search for 0xFFs. It worked for many
years, but modern NANDs have bit-flips even in empty space, so reading a
never written NAND page may return mostly 0xFFs, but with few bits set
to 0. Modern NANDs have strong ECC which can handle 4 bit errors and
above. According to Ivan, manufacturers say it is expected and OK.
No make SW like JFFS2 and UBIFS work, modern drivers need to
either correct bit-flips on blank pages automatically, or be able to
quickly distinguish between blank and non-blank pages and memset the
buffer with 0xFFs for the former case.
What Robert says is that we probably need an is_page_blank() and let the
driver implement it optimally, or make MTD fall-back to 0xFFs
comparison.
This is my understanding.
Artem.
next prev parent reply other threads:[~2011-11-13 13:35 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 [this message]
2011-11-13 16:38 ` Robert Jarzmik
2011-11-13 19:55 ` Mike Dunn
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=1321191352.2273.14.camel@koala \
--to=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=mikedunn@newsguy.com \
--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