linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3 v2] MTD: atmel_nand: modify test case for using DMA operations
Date: Fri,  1 Apr 2011 16:40:44 +0200	[thread overview]
Message-ID: <1301668844-4500-1-git-send-email-nicolas.ferre@atmel.com> (raw)
In-Reply-To: <1301662188.2789.57.camel@localhost>

We have better performances not using DMA for oob operations.
Modify size test so that it is using DMA for size greater than oobsize.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
Artem,

Here is the v2 version with embedded comment as you suggested.

Best regards,

 drivers/mtd/nand/atmel_nand.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 6fae04b..5872f2a 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -280,7 +280,8 @@ static void atmel_read_buf(struct mtd_info *mtd, u8 *buf, int len)
 	struct nand_chip *chip = mtd->priv;
 	struct atmel_nand_host *host = chip->priv;
 
-	if (use_dma && len >= mtd->oobsize)
+	if (use_dma && len > mtd->oobsize)
+		/* only use DMA for bigger than oob size: better performances */
 		if (atmel_nand_dma_op(mtd, buf, len, 1) == 0)
 			return;
 
@@ -295,7 +296,8 @@ static void atmel_write_buf(struct mtd_info *mtd, const u8 *buf, int len)
 	struct nand_chip *chip = mtd->priv;
 	struct atmel_nand_host *host = chip->priv;
 
-	if (use_dma && len >= mtd->oobsize)
+	if (use_dma && len > mtd->oobsize)
+		/* only use DMA for bigger than oob size: better performances */
 		if (atmel_nand_dma_op(mtd, (void *)buf, len, 0) == 0)
 			return;
 
-- 
1.7.3

  reply	other threads:[~2011-04-01 14:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-30  8:26 [PATCH 1/3] MTD: atmel_nand: modify test case for using DMA operations Hong Xu
2011-03-30  8:26 ` [PATCH 2/3] MTD: atmel_nand: trivial: change DMA usage information trace Hong Xu
2011-04-01 12:51   ` Artem Bityutskiy
2011-03-30  8:26 ` [PATCH 3/3] MTD/atmel_nand: Fix support for CPUs that do not support DMA access Hong Xu
2011-04-01 12:54   ` Artem Bityutskiy
2011-04-01 13:37     ` Nicolas Ferre
2011-04-01 13:37       ` Artem Bityutskiy
2011-04-01 14:17       ` Artem Bityutskiy
2011-04-01 12:49 ` [PATCH 1/3] MTD: atmel_nand: modify test case for using DMA operations Artem Bityutskiy
2011-04-01 14:40   ` Nicolas Ferre [this message]
2011-04-01 13:36     ` [PATCH 1/3 v2] " 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=1301668844-4500-1-git-send-email-nicolas.ferre@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).