public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Nick Thompson <nick.thompson@gefanuc.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH RFC] nand: remove spurious read cycle in OOB first page reads
Date: Fri, 20 Nov 2009 15:30:46 +0000	[thread overview]
Message-ID: <4B06B626.4070007@gefanuc.com> (raw)

In the case of a nand controller that needs the OOB data before
it can read the page data, an unnecessary read sequence is sent
to the nand. This reduces read performance.

This sequence is sent by default before all page reads, but the
OOB first page read function immediately issues a new command, a
simulated READOOB command, which overrides the previous sequence.

This patch (fragment) prevents the initial read sequence from
being sent if chip->ecc.mode indicates OOB first operation.

Signed-off-by: Nick Thompson <nick.thompson@gefanuc.com>
---

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 426bb95..cf85bde 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1261,7 +1272,9 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
                        bufpoi = aligned ? buf : chip->buffers->databuf;

                        if (likely(sndcmd)) {
-                               chip->cmdfunc(mtd, NAND_CMD_READ0, 0x00, page);
+                               if (chip->ecc.mode != NAND_ECC_HW_OOB_FIRST)
+                                       chip->cmdfunc(mtd, NAND_CMD_READ0,
+                                                     0x00, page);
                                sndcmd = 0;
                        }

             reply	other threads:[~2009-11-20 15:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-20 15:30 Nick Thompson [this message]
2009-11-20 20:17 ` [U-Boot] [PATCH RFC] nand: remove spurious read cycle in OOB first page reads Scott Wood
2009-11-23 10:38   ` Nick Thompson
2009-11-30 17:02     ` Scott Wood

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=4B06B626.4070007@gefanuc.com \
    --to=nick.thompson@gefanuc.com \
    --cc=u-boot@lists.denx.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