From: Artem Bityutskiy <dedekind@infradead.org>
To: Alexey Korolev <akorolev@infradead.org>
Cc: joern@logfs.org, linux-mtd@lists.infradead.org
Subject: Re: [RFC][patch] NAND partial page read functionality
Date: Tue, 18 Dec 2007 10:48:51 +0200 [thread overview]
Message-ID: <1197967731.18962.25.camel@sauron> (raw)
In-Reply-To: <Pine.LNX.4.64.0712171454550.29723@pentafluge.infradead.org>
On Mon, 2007-12-17 at 15:46 +0000, Alexey Korolev wrote:
> Good point. The question is what name would be better. I used partial
> page read because of NAND datasheet (Intel, St, Micron uses term partial
> page read or write instead of subpage read or write). May be it will be
> better to switch to this name to make search more easy?
For me it is not fundamental, but I'd vote for subpage - just because we
already have this. And wendors anyway tend to name things differently.
> > 3. Run nand-tests to make sure you did not brake anything:
> > git://git.infradead.org/~ahunter/nand-tests.git
> >
> Thank you for link - we will try it.
> (before sending out this code we performed excessive testing - about 500
> items were executed, including stress, multithread, power loss tests
This is good, but the tests I pointed to work straight with MTD devices
and were designed to test NANDs, so they might be useful anyway. For
example we found quite a few bugs in OneNAND driver with them, although
the FS tests had looked working fine.
> Yes. I looked at this implementation. Your idea of partial/subpage write implementation
> looks good. In fact there will be some drawbacks - if every request will
> become small, write performance will become lower - because writing and
> positioning are not for free.
Well, this depends. If an MTD user wants to write 4KiB, and issues 4KiB
write request, then it is of course faster to write 2x2048, then 8x512,
and it is even faster to do some kind of multi-page write (some old
flashes had this AFAIK).
But surely if the driver is not dumb, it will do 2x2048?
I've glanced at jffs2_flash_writev(), and it seems it is also not dumb -
if in needs to write a 4KiB buffer, it first finishes current
write-buffer, flushes it, then it calles mtd->write() for multiple min.
I/O units (note, it does not use wbuf now), and only the rest, which
does not comprise whole min. I/O unit, goes to the wbuf.
Thus, I'd conclude, JFFS2 should benefit.
> May be it make sence to add this feature under flag.
No, no flags please. It should either be transparent of not exist I
believe :-)
> It is not clear how to handle the situation with oob write requests.
> What to do if some one wil ask to write a part of page and oob at the
> same time?
Yup, it seems to be a problem.
> I did not understand this part of the code about subpage write:
> /*
> * Allow subpage writes up to ecc.steps. Not possible for MLC
> * FLASH.
> */
> if (!(chip->options & NAND_NO_SUBPAGE_WRITE) &&
> !(chip->cellinfo & NAND_CI_CELLTYPE_MSK)) {
> switch(chip->ecc.steps) {
> case 2:
> mtd->subpage_sft = 1;
> break;
> case 4:
> case 8:
> mtd->subpage_sft = 2;
> break;
> }
> }
> Why it sets subpage shift to 2 in case of eight ECC steps? It should be
> 3. (step size is 1/8 of page)
Frankly, I do not deeply understand nand_base.c, but it looks like you
are right. Thomas Gleixner is the author, you should ask him.
> > > #define NAND_HAS_COPYBACK(chip) ((chip->options & NAND_COPYBACK))
> > > +#define NAND_CANPARTREAD(chip) ((chip->options & NAND_PART_READ) &&\
> > > + (chip->ecc.mode == NAND_ECC_SOFT))
> >
> > Why chip->ecc.mode == NAND_ECC_SOFT?
> >
> I added this limitation because I have only ECC_SOFT chips and afraid to
> broke workability non SOFT_ECC chiups. I guess it should work fine for
> other devices. Just kind of over protection. It is not a problem to
> remove it.
Well, I could try your patch on OLPC which has an ST-Micro NAND and CAFE
controller which, among other things, does HW ECC for NAND.
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
next prev parent reply other threads:[~2007-12-18 8:49 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-13 18:15 [RFC][patch] NAND partial page read functionality Alexey Korolev
2007-12-15 12:13 ` Artem Bityutskiy
2007-12-17 15:46 ` Alexey Korolev
2007-12-18 8:48 ` Artem Bityutskiy [this message]
2007-12-18 11:42 ` Jörn Engel
2007-12-18 12:57 ` Artem Bityutskiy
2007-12-18 13:51 ` Jörn Engel
2008-04-24 6:34 ` Artem Bityutskiy
2008-04-24 7:11 ` Artem Bityutskiy
2008-04-24 7:45 ` Hamish Moffatt
2008-04-24 9:53 ` Artem Bityutskiy
2008-04-24 10:25 ` Alexey Korolev
2008-04-24 10:45 ` Artem Bityutskiy
2008-04-24 10:57 ` Alexey Korolev
2008-04-24 14:04 ` Hamish Moffatt
2008-04-24 14:48 ` Alexey Korolev
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=1197967731.18962.25.camel@sauron \
--to=dedekind@infradead.org \
--cc=akorolev@infradead.org \
--cc=joern@logfs.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox