MTD: atmel_nand: modify test case for using DMA operations
PATCH 1/3 MTD: atmel_nand: modify test case for using DMA operations
From: Nicolas Ferre <[email protected]>
We have better performances not using DMA for oob operations. Modify size test so that it is using DMA for size greater than oobsize.
--- drivers/mtd/nand/atmel_nand.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/nand/atmel_nand.c +2 -2
@@ -280,7 +280,7 @@ 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)if (atmel_nand_dma_op (mtd, buf, len,1 ) ==0 )return ;
@@ -295,7 +295,7 @@ 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)if (atmel_nand_dma_op (mtd, (void *)buf, len,0 ) ==0 )return ;
Signature · 1 line
1.7.3.3
PATCH 2/3 MTD: atmel_nand: trivial: change DMA usage information trace
From: Nicolas Ferre <[email protected]>
--- drivers/mtd/nand/atmel_nand.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/mtd/nand/atmel_nand.c +2 -1
@@ -611,7 +611,8 @@ static int __init atmel_nand_probe(struct platform_device *pdev) } }if (use_dma) -dev_info (host->dev,"Using DMA for NAND access.\n" ); +dev_info (host->dev,"Using %s for DMA transfers.\n" , +dma_chan_name (host->dma_chan));else dev_info (host->dev,"No DMA support for NAND access.\n" );
Signature · 1 line
1.7.3.3
PATCH 2/3 MTD: atmel_nand: trivial: change DMA usage information trace
Quoted 3 lines · Hong Xu
From: Nicolas Ferre <[email protected]>
Signed-off-by Nicolas Ferre <[email protected]>
Pushed this patch to the l2-mtd-2.6.git tree, thanks.
Signature · 2 lines
Best Regards, Artem Bityutskiy (????? ????????)
PATCH 3/3 MTD/atmel_nand: Fix support for CPUs that do not support DMA access
In reply to Hong Xuuse_dma was always "1" even if the CPU does not support DMA
Tested on AT91SAM9261EK by Jean-Christophe PLAGNIOL-VILLARD
--- drivers/mtd/nand/atmel_nand.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/mtd/nand/atmel_nand.c +4 -1
@@ -599,7 +599,10 @@ static int __init atmel_nand_probe(struct platform_device *pdev) nand_chip->options |=NAND_USE_FLASH_BBT ; } -if (cpu_has_dma () && use_dma) { +if (!cpu_has_dma ()) + use_dma =0 ; + +if (use_dma) {dma_cap_mask_t mask;dma_cap_zero (mask);
Signature · 1 line
1.7.3.3
Artem Bityutskiy
AppliedPATCH 3/3 MTD/atmel_nand: Fix support for CPUs that do not support DMA access
Quoted 6 lines · Hong Xu
use_dmawas always "1" even if the CPU does not support DMATested on AT91SAM9261EK by Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by Hong Xu <[email protected]>
Pushed to l2-mtd-2.6.git tree. This looks like a candidate for the stable tree - should it be sent there?
Signature · 2 lines
Best Regards, Artem Bityutskiy (????? ????????)
PATCH 3/3 MTD/atmel_nand: Fix support for CPUs that do not support DMA access
Le 01/04/2011 14:54, Artem Bityutskiy :
Quoted 10 lines · Hong Xu
Quoted 6 lines
use_dmawas always "1" even if the CPU does not support DMATested on AT91SAM9261EK by Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by Hong Xu <[email protected]>Pushed to l2-mtd-2.6.git tree. This looks like a candidate for the stable tree - should it be sent there?
Well, definitively the whole series is a candidate for .39-xx (also with the "[PATCH] MTD: atmel_nand: Fall back to CPU I/O when buffer is in vmalloc(ed) region" that follows.
But, as DMA access was not included in .38, stable tree should not be impacted.
Best regards,
Signature · 1 line
Nicolas Ferre
PATCH 3/3 MTD/atmel_nand: Fix support for CPUs that do not support DMA access
Quoted 12 lines · Nicolas Ferre
Le 01/04/2011 14:54, Artem Bityutskiy :
Quoted 10 lines · Hong Xu
Quoted 6 lines
use_dmawas always "1" even if the CPU does not support DMATested on AT91SAM9261EK by Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by Hong Xu <[email protected]>Pushed to l2-mtd-2.6.git tree. This looks like a candidate for the stable tree - should it be sent there?
Quoted 6 lines
Well, definitively the whole series is a candidate for .39-xx (also with the "[PATCH] MTD:
atmel_nand: Fall back to CPU I/O when buffer is in vmalloc(ed) region" that follows.But, as DMA access was not included in .38, stable tree should not be impacted.
I see, then this is not -stable material. But should be merged this merge window.
Signature · 2 lines
Best Regards, Artem Bityutskiy (????? ????????)
PATCH 3/3 MTD/atmel_nand: Fix support for CPUs that do not support DMA access
In reply to Nicolas FerreQuoted 9 lines · Nicolas Ferre
Le 01/04/2011 14:54, Artem Bityutskiy :
Quoted 8 lines · Hong Xu
Quoted 6 lines
use_dmawas always "1" even if the CPU does not support DMATested on AT91SAM9261EK by Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by Hong Xu <[email protected]>
Quoted 6 lines
Quoted 2 lines
Pushed to l2-mtd-2.6.git tree. This looks like a candidate for the stable tree - should it be sent there?
Well, definitively the whole series is a candidate for .39-xx (also with the "[PATCH] MTD:
atmel_nand: Fall back to CPU I/O when buffer is in vmalloc(ed) region" that follows.
Thanks for pointing this, I could miss that patch.
Signature · 2 lines
Best Regards, Artem Bityutskiy (????? ????????)
PATCH 1/3 MTD: atmel_nand: modify test case for using DMA operations
In reply to Hong XuQuoted 3 lines · Hong Xu
From: Nicolas Ferre <[email protected]>
We have better performances not using DMA for oob operations.
Would it be possible to have this comment in the code, not only in the commit message?
Quoted 3 lines
Modify size test so that it is using DMA for size greater than oobsize.
Signed-off-by Nicolas Ferre <[email protected]>
Signature · 2 lines
Best Regards, Artem Bityutskiy (????? ????????)
PATCH v2 1/3 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.
---
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(-)
drivers/mtd/nand/atmel_nand.c +4 -2
@@ -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 ;
Signature · 1 line
1.7.3
Artem Bityutskiy
AppliedQuoted 4 lines · Nicolas Ferre
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 <[email protected]>
Pushed to l2-mtd-2.6.git, thank you!
Signature · 2 lines
Best Regards, Artem Bityutskiy (????? ????????)