mtd: atmel_nand: modify test case for using DMA operations

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Thu Apr 7 05:59:02 EDT 2011


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=9d51567e47a0d84f6b6e7751a4ea4f710cdcbbdf
Commit:     9d51567e47a0d84f6b6e7751a4ea4f710cdcbbdf
Parent:     cb457a4ddd4eeac9c81792a1e6a5d59b1b44abe1
Author:     Nicolas Ferre <nicolas.ferre at atmel.com>
AuthorDate: Fri Apr 1 16:40:44 2011 +0200
Committer:  Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
CommitDate: Fri Apr 1 16:44:32 2011 +0300

    mtd: atmel_nand: modify test case for using DMA operations
    
    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 at atmel.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
---
 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 f254fa6..e9fdbe4 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;
 



More information about the linux-mtd-cvs mailing list