linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Boris Brezillon <bbrezillon@kernel.org>
To: "Bean Huo (beanhuo)" <beanhuo@micron.com>
Cc: "boris.brezillon@bootlin.com" <boris.brezillon@bootlin.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	"richard@nod.at" <richard@nod.at>,
	"miquel.raynal@bootlin.com" <miquel.raynal@bootlin.com>
Subject: Re: [RESEND PATCH V2 2/2] mtd: core: NAND filling block
Date: Sun, 20 Jan 2019 18:31:56 +0100	[thread overview]
Message-ID: <20190120183156.1bd98914@bbrezillon> (raw)
In-Reply-To: <20190118233943.5f003eef@bbrezillon>

On Fri, 18 Jan 2019 23:39:43 +0100
Boris Brezillon <bbrezillon@kernel.org> wrote:


> > Otherwise,
> > +	 * then we check page0. And if page0 is programmed, and page13
> > +	 * is not programmed, then we start to check from page11, page9,
> > +	 * page7, page5, page3 respectively since the pages of PEB are
> > +	 * programmed sequentially.  
> 
> Looks overly complex for only a small gain. Did you try writing X (X
> being 14 in this case) pages all the time? If you did, how does it
> compare to this version (perf-wise). I suspect that reading pages
> before potentially overwriting them will actually take more time than
> blindly overwriting 14 pages with 0x00.

I looked at various datasheets and PROG time is indeed much bigger than
READ time, so the benefit of reading before writing is mainly dependent
on the page transfer time on the bus, which is highly dependent on the
controller and the page size. Maybe it's not such a bad idea to try to
figure out which pages have been written before overwriting them (but
in some cases it might be worse than directly overwriting the 16
first pages).

In any case, I think it'd be good to keep track of which pages have been
programmed at runtime. Assuming you only want to track the 16 first
pages, all you'll need is an u16 (bitmap) per block. When any of the 16
first pages of a block is written you set the corresponding bit, when
the block is erased you clear the u16 entry. This way, you only have to
figure out which blocks are partially written once after a cold boot.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2019-01-20 17:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18 22:12 [RESEND PATCH V2 2/2] mtd: core: NAND filling block Bean Huo (beanhuo)
2019-01-18 22:39 ` Boris Brezillon
2019-01-20 17:31   ` Boris Brezillon [this message]
2019-01-21 12:28   ` [EXT] " Bean Huo (beanhuo)
2019-01-21 12:44     ` Boris Brezillon
2019-01-25 13:39       ` Bean Huo (beanhuo)
2019-01-25 14:10         ` Boris Brezillon
2019-01-18 23:01 ` Boris Brezillon
2019-01-21 10:04   ` [EXT] " Bean Huo (beanhuo)
2019-01-21 10:12     ` Boris Brezillon
2019-01-25 13:31       ` Bean Huo (beanhuo)
2019-01-25 14:15         ` Boris Brezillon
2019-01-20 15:59 ` Miquel Raynal
2019-01-24 15:47   ` [EXT] " Bean Huo (beanhuo)
2019-01-24 20:02     ` Miquel Raynal
2019-01-20 17:36 ` Boris Brezillon

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=20190120183156.1bd98914@bbrezillon \
    --to=bbrezillon@kernel.org \
    --cc=beanhuo@micron.com \
    --cc=boris.brezillon@bootlin.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).