linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] MTD: atmel_nand: modify test case for using DMA operations
@ 2011-03-30  8:26 Hong Xu
  2011-03-30  8:26 ` [PATCH 2/3] MTD: atmel_nand: trivial: change DMA usage information trace Hong Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Hong Xu @ 2011-03-30  8:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Nicolas Ferre <nicolas.ferre@atmel.com>

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>
---
 drivers/mtd/nand/atmel_nand.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 6fae04b..9acecdc 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -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;
 
-- 
1.7.3.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/3] MTD: atmel_nand: trivial: change DMA usage information trace
  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 ` 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:49 ` [PATCH 1/3] MTD: atmel_nand: modify test case for using DMA operations Artem Bityutskiy
  2 siblings, 1 reply; 11+ messages in thread
From: Hong Xu @ 2011-03-30  8:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Nicolas Ferre <nicolas.ferre@atmel.com>

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/mtd/nand/atmel_nand.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 9acecdc..c36ea50 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -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");
 
-- 
1.7.3.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/3] MTD/atmel_nand: Fix support for CPUs that do not support DMA access
  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-03-30  8:26 ` Hong Xu
  2011-04-01 12:54   ` Artem Bityutskiy
  2011-04-01 12:49 ` [PATCH 1/3] MTD: atmel_nand: modify test case for using DMA operations Artem Bityutskiy
  2 siblings, 1 reply; 11+ messages in thread
From: Hong Xu @ 2011-03-30  8:26 UTC (permalink / raw)
  To: linux-arm-kernel

use_dma was always "1" even if the CPU does not support DMA

Tested on AT91SAM9261EK by Jean-Christophe PLAGNIOL-VILLARD

Reported-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Hong Xu <hong.xu@atmel.com>
---
 drivers/mtd/nand/atmel_nand.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index c36ea50..1b43654 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -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);
-- 
1.7.3.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 1/3] MTD: atmel_nand: modify test case for using DMA operations
  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-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:49 ` Artem Bityutskiy
  2011-04-01 14:40   ` [PATCH 1/3 v2] " Nicolas Ferre
  2 siblings, 1 reply; 11+ messages in thread
From: Artem Bityutskiy @ 2011-04-01 12:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2011-03-30 at 16:26 +0800, Hong Xu wrote:
> From: Nicolas Ferre <nicolas.ferre@atmel.com>
> 
> 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?

> Modify size test so that it is using DMA for size greater than oobsize.
> 
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>

-- 
Best Regards,
Artem Bityutskiy (????? ????????)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 2/3] MTD: atmel_nand: trivial: change DMA usage information trace
  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
  0 siblings, 0 replies; 11+ messages in thread
From: Artem Bityutskiy @ 2011-04-01 12:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2011-03-30 at 16:26 +0800, Hong Xu wrote:
> From: Nicolas Ferre <nicolas.ferre@atmel.com>
> 
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Pushed this patch to the l2-mtd-2.6.git tree, thanks.

-- 
Best Regards,
Artem Bityutskiy (????? ????????)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 3/3] MTD/atmel_nand: Fix support for CPUs that do not support DMA access
  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
  0 siblings, 1 reply; 11+ messages in thread
From: Artem Bityutskiy @ 2011-04-01 12:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2011-03-30 at 16:26 +0800, Hong Xu wrote:
> use_dma was always "1" even if the CPU does not support DMA
> 
> Tested on AT91SAM9261EK by Jean-Christophe PLAGNIOL-VILLARD
> 
> Reported-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Signed-off-by: Hong Xu <hong.xu@atmel.com>

Pushed to l2-mtd-2.6.git tree. This looks like a candidate for the
stable tree - should it be sent there?

-- 
Best Regards,
Artem Bityutskiy (????? ????????)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/3 v2] MTD: atmel_nand: modify test case for using DMA operations
  2011-04-01 14:40   ` [PATCH 1/3 v2] " Nicolas Ferre
@ 2011-04-01 13:36     ` Artem Bityutskiy
  0 siblings, 0 replies; 11+ messages in thread
From: Artem Bityutskiy @ 2011-04-01 13:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 2011-04-01 at 16:40 +0200, Nicolas Ferre wrote:
> 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>

Pushed to l2-mtd-2.6.git, thank you!

-- 
Best Regards,
Artem Bityutskiy (????? ????????)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 3/3] MTD/atmel_nand: Fix support for CPUs that do not support DMA access
  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
  0 siblings, 2 replies; 11+ messages in thread
From: Nicolas Ferre @ 2011-04-01 13:37 UTC (permalink / raw)
  To: linux-arm-kernel

Le 01/04/2011 14:54, Artem Bityutskiy :
> On Wed, 2011-03-30 at 16:26 +0800, Hong Xu wrote:
>> use_dma was always "1" even if the CPU does not support DMA
>>
>> Tested on AT91SAM9261EK by Jean-Christophe PLAGNIOL-VILLARD
>>
>> Reported-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>> Signed-off-by: Hong Xu <hong.xu@atmel.com>
> 
> 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,
-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 3/3] MTD/atmel_nand: Fix support for CPUs that do not support DMA access
  2011-04-01 13:37     ` Nicolas Ferre
@ 2011-04-01 13:37       ` Artem Bityutskiy
  2011-04-01 14:17       ` Artem Bityutskiy
  1 sibling, 0 replies; 11+ messages in thread
From: Artem Bityutskiy @ 2011-04-01 13:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 2011-04-01 at 15:37 +0200, Nicolas Ferre wrote:
> Le 01/04/2011 14:54, Artem Bityutskiy :
> > On Wed, 2011-03-30 at 16:26 +0800, Hong Xu wrote:
> >> use_dma was always "1" even if the CPU does not support DMA
> >>
> >> Tested on AT91SAM9261EK by Jean-Christophe PLAGNIOL-VILLARD
> >>
> >> Reported-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> >> Signed-off-by: Hong Xu <hong.xu@atmel.com>
> > 
> > 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.

I see, then this is not -stable material. But should be merged this
merge window.

-- 
Best Regards,
Artem Bityutskiy (????? ????????)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 3/3] MTD/atmel_nand: Fix support for CPUs that do not support DMA access
  2011-04-01 13:37     ` Nicolas Ferre
  2011-04-01 13:37       ` Artem Bityutskiy
@ 2011-04-01 14:17       ` Artem Bityutskiy
  1 sibling, 0 replies; 11+ messages in thread
From: Artem Bityutskiy @ 2011-04-01 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 2011-04-01 at 15:37 +0200, Nicolas Ferre wrote:
> Le 01/04/2011 14:54, Artem Bityutskiy :
> > On Wed, 2011-03-30 at 16:26 +0800, Hong Xu wrote:
> >> use_dma was always "1" even if the CPU does not support DMA
> >>
> >> Tested on AT91SAM9261EK by Jean-Christophe PLAGNIOL-VILLARD
> >>
> >> Reported-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> >> Signed-off-by: Hong Xu <hong.xu@atmel.com>
> > 
> > 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.

-- 
Best Regards,
Artem Bityutskiy (????? ????????)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/3 v2] MTD: atmel_nand: modify test case for using DMA operations
  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
  2011-04-01 13:36     ` Artem Bityutskiy
  0 siblings, 1 reply; 11+ messages in thread
From: Nicolas Ferre @ 2011-04-01 14:40 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-04-01 14:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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   ` [PATCH 1/3 v2] " Nicolas Ferre
2011-04-01 13:36     ` Artem Bityutskiy

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).