LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* dmaengine: i.MX dma fixes
@ 2011-01-31 12:00 Sascha Hauer
  2011-01-31 12:00 ` [PATCH 1/4] dmaengine i.MX dma: set maximum segment size for our device Sascha Hauer
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Sascha Hauer @ 2011-01-31 12:00 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Dan Williams, linux-kernel

The following contains fixes for the i.MX dma driver.

Sascha

The following changes since commit 1bae4ce27c9c90344f23c65ea6966c50ffeae2f5:

  Linux 2.6.38-rc2 (2011-01-21 19:01:34 -0800)

are available in the git repository at:
  git://git.pengutronix.de/git/imx/linux-2.6 dmaengine-imxdma

Sascha Hauer (4):
      dmaengine i.MX dma: set maximum segment size for our device
      dmaengine i.MX dma: check sg entries for valid addresses and lengths
      dmaengine i.MX DMA: do not initialize chan_id field
      dmaengine i.MX dma: initialize dma capabilities outside channel loop

 drivers/dma/imx-dma.c |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

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

* [PATCH 1/4] dmaengine i.MX dma: set maximum segment size for our device
  2011-01-31 12:00 dmaengine: i.MX dma fixes Sascha Hauer
@ 2011-01-31 12:00 ` Sascha Hauer
  2011-01-31 12:00 ` [PATCH 2/4] dmaengine i.MX dma: check sg entries for valid addresses and lengths Sascha Hauer
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2011-01-31 12:00 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Dan Williams, linux-kernel, Sascha Hauer

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/dma/imx-dma.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index e53d438..a46e1d9 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -49,6 +49,7 @@ struct imxdma_channel {
 
 struct imxdma_engine {
 	struct device			*dev;
+	struct device_dma_parameters	dma_parms;
 	struct dma_device		dma_device;
 	struct imxdma_channel		channel[MAX_DMA_CHANNELS];
 };
@@ -370,6 +371,9 @@ static int __init imxdma_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, imxdma);
 
+	imxdma->dma_device.dev->dma_parms = &imxdma->dma_parms;
+	dma_set_max_seg_size(imxdma->dma_device.dev, 0xffffff);
+
 	ret = dma_async_device_register(&imxdma->dma_device);
 	if (ret) {
 		dev_err(&pdev->dev, "unable to register\n");
-- 
1.7.2.3


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

* [PATCH 2/4] dmaengine i.MX dma: check sg entries for valid addresses and lengths
  2011-01-31 12:00 dmaengine: i.MX dma fixes Sascha Hauer
  2011-01-31 12:00 ` [PATCH 1/4] dmaengine i.MX dma: set maximum segment size for our device Sascha Hauer
@ 2011-01-31 12:00 ` Sascha Hauer
  2011-01-31 12:00 ` [PATCH 3/4] dmaengine i.MX DMA: do not initialize chan_id field Sascha Hauer
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2011-01-31 12:00 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Dan Williams, linux-kernel, Sascha Hauer

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/dma/imx-dma.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index a46e1d9..a1eac99 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -243,6 +243,21 @@ static struct dma_async_tx_descriptor *imxdma_prep_slave_sg(
 	else
 		dmamode = DMA_MODE_WRITE;
 
+	switch (imxdmac->word_size) {
+	case DMA_SLAVE_BUSWIDTH_4_BYTES:
+		if (sgl->length & 3 || sgl->dma_address & 3)
+			return NULL;
+		break;
+	case DMA_SLAVE_BUSWIDTH_2_BYTES:
+		if (sgl->length & 1 || sgl->dma_address & 1)
+			return NULL;
+		break;
+	case DMA_SLAVE_BUSWIDTH_1_BYTE:
+		break;
+	default:
+		return NULL;
+	}
+
 	ret = imx_dma_setup_sg(imxdmac->imxdma_channel, sgl, sg_len,
 		 dma_length, imxdmac->per_address, dmamode);
 	if (ret)
-- 
1.7.2.3


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

* [PATCH 3/4] dmaengine i.MX DMA: do not initialize chan_id field
  2011-01-31 12:00 dmaengine: i.MX dma fixes Sascha Hauer
  2011-01-31 12:00 ` [PATCH 1/4] dmaengine i.MX dma: set maximum segment size for our device Sascha Hauer
  2011-01-31 12:00 ` [PATCH 2/4] dmaengine i.MX dma: check sg entries for valid addresses and lengths Sascha Hauer
@ 2011-01-31 12:00 ` Sascha Hauer
  2011-01-31 12:00 ` [PATCH 4/4] dmaengine i.MX dma: initialize dma capabilities outside channel loop Sascha Hauer
  2011-01-31 12:21 ` dmaengine: i.MX dma fixes Sergei Shtylyov
  4 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2011-01-31 12:00 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Dan Williams, linux-kernel, Sascha Hauer

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/dma/imx-dma.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index a1eac99..8262708 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -366,7 +366,6 @@ static int __init imxdma_probe(struct platform_device *pdev)
 		dma_cap_set(DMA_CYCLIC, imxdma->dma_device.cap_mask);
 
 		imxdmac->chan.device = &imxdma->dma_device;
-		imxdmac->chan.chan_id = i;
 		imxdmac->channel = i;
 
 		/* Add the channel to the DMAC list */
-- 
1.7.2.3


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

* [PATCH 4/4] dmaengine i.MX dma: initialize dma capabilities outside channel loop
  2011-01-31 12:00 dmaengine: i.MX dma fixes Sascha Hauer
                   ` (2 preceding siblings ...)
  2011-01-31 12:00 ` [PATCH 3/4] dmaengine i.MX DMA: do not initialize chan_id field Sascha Hauer
@ 2011-01-31 12:00 ` Sascha Hauer
  2011-01-31 12:21 ` dmaengine: i.MX dma fixes Sergei Shtylyov
  4 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2011-01-31 12:00 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Dan Williams, linux-kernel, Sascha Hauer

The capabilities are device specific fields, not channel specific fields.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/dma/imx-dma.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index 8262708..e18eaab 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -345,6 +345,9 @@ static int __init imxdma_probe(struct platform_device *pdev)
 
 	INIT_LIST_HEAD(&imxdma->dma_device.channels);
 
+	dma_cap_set(DMA_SLAVE, imxdma->dma_device.cap_mask);
+	dma_cap_set(DMA_CYCLIC, imxdma->dma_device.cap_mask);
+
 	/* Initialize channel parameters */
 	for (i = 0; i < MAX_DMA_CHANNELS; i++) {
 		struct imxdma_channel *imxdmac = &imxdma->channel[i];
@@ -362,9 +365,6 @@ static int __init imxdma_probe(struct platform_device *pdev)
 		imxdmac->imxdma = imxdma;
 		spin_lock_init(&imxdmac->lock);
 
-		dma_cap_set(DMA_SLAVE, imxdma->dma_device.cap_mask);
-		dma_cap_set(DMA_CYCLIC, imxdma->dma_device.cap_mask);
-
 		imxdmac->chan.device = &imxdma->dma_device;
 		imxdmac->channel = i;
 
-- 
1.7.2.3


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

* Re: dmaengine: i.MX dma fixes
  2011-01-31 12:00 dmaengine: i.MX dma fixes Sascha Hauer
                   ` (3 preceding siblings ...)
  2011-01-31 12:00 ` [PATCH 4/4] dmaengine i.MX dma: initialize dma capabilities outside channel loop Sascha Hauer
@ 2011-01-31 12:21 ` Sergei Shtylyov
  4 siblings, 0 replies; 6+ messages in thread
From: Sergei Shtylyov @ 2011-01-31 12:21 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: linux-arm-kernel, Dan Williams, linux-kernel

Hello.

On 31-01-2011 15:00, Sascha Hauer wrote:

> The following contains fixes for the i.MX dma driver.

> Sascha

> The following changes since commit 1bae4ce27c9c90344f23c65ea6966c50ffeae2f5:

>    Linux 2.6.38-rc2 (2011-01-21 19:01:34 -0800)

> are available in the git repository at:
>    git://git.pengutronix.de/git/imx/linux-2.6 dmaengine-imxdma

> Sascha Hauer (4):
>        dmaengine i.MX dma: set maximum segment size for our device
>        dmaengine i.MX dma: check sg entries for valid addresses and lengths
>        dmaengine i.MX DMA: do not initialize chan_id field
>        dmaengine i.MX dma: initialize dma capabilities outside channel loop

>   drivers/dma/imx-dma.c |   26 ++++++++++++++++++++++----
>   1 files changed, 22 insertions(+), 4 deletions(-)

    Actually, would have made sense to combine the analogous changes to SDMA 
and DMA drivers into the single patch...

WBR, Sergei

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

end of thread, other threads:[~2011-01-31 12:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-31 12:00 dmaengine: i.MX dma fixes Sascha Hauer
2011-01-31 12:00 ` [PATCH 1/4] dmaengine i.MX dma: set maximum segment size for our device Sascha Hauer
2011-01-31 12:00 ` [PATCH 2/4] dmaengine i.MX dma: check sg entries for valid addresses and lengths Sascha Hauer
2011-01-31 12:00 ` [PATCH 3/4] dmaengine i.MX DMA: do not initialize chan_id field Sascha Hauer
2011-01-31 12:00 ` [PATCH 4/4] dmaengine i.MX dma: initialize dma capabilities outside channel loop Sascha Hauer
2011-01-31 12:21 ` dmaengine: i.MX dma fixes Sergei Shtylyov

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