summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@atmel.com>2011-04-01 16:40:44 +0200
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-04-01 15:44:32 +0200
commit9d51567e47a0d84f6b6e7751a4ea4f710cdcbbdf (patch)
tree08cfcbd8004fb25929486e7127635a78c924113c
parentmtd: atmel_nand: fix support for CPUs that do not support DMA access (diff)
downloadlinux-9d51567e47a0d84f6b6e7751a4ea4f710cdcbbdf.tar.xz
linux-9d51567e47a0d84f6b6e7751a4ea4f710cdcbbdf.zip
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@atmel.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r--drivers/mtd/nand/atmel_nand.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index f254fa636afc..e9fdbe46b247 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;