2014-10-11 16:14:14

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 00/12] dmaengine: remove users of device_control

The recent discussion [1] on the API have resulted in moving away from
device_control ioctl method to proper channel APIs.
There are still few users on the device_control which should use the wrappers
existing rather than access device_control.
This will aid us in deprecating and removing device_control, possibly after
the merge window.

These can be merged thru respective subsystem tree or dmaengine tree. Either
way please just let me know.

Feng's kbuild has tested these as well [2]

[1]: http://www.spinics.net/lists/dmaengine/msg02212.html
[2]: http://git.infradead.org/users/vkoul/slave-dma.git/shortlog/refs/heads/topic/dma_control_cleanup

Vinod Koul (12):
pata_arasan_cf: use dmaengine_terminate_all() API
dmaengine: coh901318: use dmaengine_terminate_all() API
[media] V4L2: mx3_camer: use dmaengine_pause() API
mtd: fsmc_nand: use dmaengine_terminate_all() API
mtd: sh_flctl: use dmaengine_terminate_all() API
net: ks8842: use dmaengine_terminate_all() API
spi/atmel: use dmaengine_terminate_all() API
spi/spi-dw-mid.c: use dmaengine_slave_config() API
serial: sh-sci: use dmaengine_terminate_all() API
usb: musb: ux500_dma: use dmaengine_xxx() APIs
ASoC: txx9: use dmaengine_terminate_all() API
video: mx3fb: use dmaengine_terminate_all() API

drivers/ata/pata_arasan_cf.c | 5 ++---
drivers/dma/coh901318.c | 2 +-
drivers/media/platform/soc_camera/mx3_camera.c | 6 ++----
drivers/mtd/nand/fsmc_nand.c | 2 +-
drivers/mtd/nand/sh_flctl.c | 2 +-
drivers/net/ethernet/micrel/ks8842.c | 6 ++----
drivers/spi/spi-atmel.c | 6 ++----
drivers/spi/spi-dw-mid.c | 6 ++----
drivers/tty/serial/sh-sci.c | 2 +-
drivers/usb/musb/ux500_dma.c | 7 ++-----
drivers/video/fbdev/mx3fb.c | 3 +--
sound/soc/txx9/txx9aclc.c | 7 +++----
12 files changed, 20 insertions(+), 34 deletions(-)


2014-10-11 16:14:47

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 01/12] pata_arasan_cf: use dmaengine_terminate_all() API

The drivers should use dmaengine_terminate_all() API instead of accessing
the device_control which will be deprecated soon

Signed-off-by: Vinod Koul <[email protected]>
---
drivers/ata/pata_arasan_cf.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
index 4edb1a8..38216b9 100644
--- a/drivers/ata/pata_arasan_cf.c
+++ b/drivers/ata/pata_arasan_cf.c
@@ -420,7 +420,7 @@ dma_xfer(struct arasan_cf_dev *acdev, dma_addr_t src, dma_addr_t dest, u32 len)

/* Wait for DMA to complete */
if (!wait_for_completion_timeout(&acdev->dma_completion, TIMEOUT)) {
- chan->device->device_control(chan, DMA_TERMINATE_ALL, 0);
+ dmaengine_terminate_all(chan);
dev_err(acdev->host->dev, "wait_for_completion_timeout\n");
return -ETIMEDOUT;
}
@@ -928,8 +928,7 @@ static int arasan_cf_suspend(struct device *dev)
struct arasan_cf_dev *acdev = host->ports[0]->private_data;

if (acdev->dma_chan)
- acdev->dma_chan->device->device_control(acdev->dma_chan,
- DMA_TERMINATE_ALL, 0);
+ dmaengine_terminate_all(acdev->dma_chan);

cf_exit(acdev);
return ata_host_suspend(host, PMSG_SUSPEND);
--
1.7.0.4

2014-10-11 16:14:50

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 02/12] dmaengine: coh901318: use dmaengine_terminate_all() API

The drivers should use dmaengine_terminate_all() API instead of accessing
the device_control which will be deprecated soon

Signed-off-by: Vinod Koul <[email protected]>
---
drivers/dma/coh901318.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/coh901318.c b/drivers/dma/coh901318.c
index 3c6716e..e88588d 100644
--- a/drivers/dma/coh901318.c
+++ b/drivers/dma/coh901318.c
@@ -2156,7 +2156,7 @@ coh901318_free_chan_resources(struct dma_chan *chan)

spin_unlock_irqrestore(&cohc->lock, flags);

- chan->device->device_control(chan, DMA_TERMINATE_ALL, 0);
+ dmaengine_terminate_all(chan);
}


--
1.7.0.4

2014-10-11 16:15:00

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 04/12] mtd: fsmc_nand: use dmaengine_terminate_all() API

The drivers should use dmaengine_terminate_all() API instead of
accessing the device_control which will be deprecated soon

Signed-off-by: Vinod Koul <[email protected]>
---
drivers/mtd/nand/fsmc_nand.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index 1550692..7a91587 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -605,7 +605,7 @@ static int dma_xfer(struct fsmc_nand_data *host, void *buffer, int len,
wait_for_completion_timeout(&host->dma_access_complete,
msecs_to_jiffies(3000));
if (ret <= 0) {
- chan->device->device_control(chan, DMA_TERMINATE_ALL, 0);
+ dmaengine_terminate_all(chan);
dev_err(host->dev, "wait_for_completion_timeout\n");
if (!ret)
ret = -ETIMEDOUT;
--
1.7.0.4

2014-10-11 16:14:53

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 03/12] [media] V4L2: mx3_camer: use dmaengine_pause() API

The drivers should use dmaengine_pause() API instead of
accessing the device_control which will be deprecated soon

Signed-off-by: Vinod Koul <[email protected]>
---
drivers/media/platform/soc_camera/mx3_camera.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/soc_camera/mx3_camera.c b/drivers/media/platform/soc_camera/mx3_camera.c
index 83315df..7696a87 100644
--- a/drivers/media/platform/soc_camera/mx3_camera.c
+++ b/drivers/media/platform/soc_camera/mx3_camera.c
@@ -415,10 +415,8 @@ static void mx3_stop_streaming(struct vb2_queue *q)
struct mx3_camera_buffer *buf, *tmp;
unsigned long flags;

- if (ichan) {
- struct dma_chan *chan = &ichan->dma_chan;
- chan->device->device_control(chan, DMA_PAUSE, 0);
- }
+ if (ichan)
+ dmaengine_pause(&ichan->dma_chan);

spin_lock_irqsave(&mx3_cam->lock, flags);

--
1.7.0.4

2014-10-11 16:15:07

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 05/12] mtd: sh_flctl: use dmaengine_terminate_all() API

The drivers should use dmaengine_terminate_all() API instead of
accessing the device_control which will be deprecated soon

Signed-off-by: Vinod Koul <[email protected]>
---
drivers/mtd/nand/sh_flctl.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c
index c067023..0ed7c60 100644
--- a/drivers/mtd/nand/sh_flctl.c
+++ b/drivers/mtd/nand/sh_flctl.c
@@ -395,7 +395,7 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf,
msecs_to_jiffies(3000));

if (ret <= 0) {
- chan->device->device_control(chan, DMA_TERMINATE_ALL, 0);
+ dmaengine_terminate_all(chan);
dev_err(&flctl->pdev->dev, "wait_for_completion_timeout\n");
}

--
1.7.0.4

2014-10-11 16:15:17

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 07/12] spi/atmel: use dmaengine_terminate_all() API

The drivers should use dmaengine_terminate_all() API instead of
accessing the device_control which will be deprecated soon

Signed-off-by: Vinod Koul <[email protected]>
---
drivers/spi/spi-atmel.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 113c83f..649dcb5 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -482,11 +482,9 @@ error:
static void atmel_spi_stop_dma(struct atmel_spi *as)
{
if (as->dma.chan_rx)
- as->dma.chan_rx->device->device_control(as->dma.chan_rx,
- DMA_TERMINATE_ALL, 0);
+ dmaengine_terminate_all(as->dma.chan_rx);
if (as->dma.chan_tx)
- as->dma.chan_tx->device->device_control(as->dma.chan_tx,
- DMA_TERMINATE_ALL, 0);
+ dmaengine_terminate_all(as->dma.chan_tx);
}

static void atmel_spi_release_dma(struct atmel_spi *as)
--
1.7.0.4

2014-10-11 16:15:29

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 08/12] spi/spi-dw-mid.c: use dmaengine_slave_config() API

The drivers should use dmaengine_slave_config() API instead of
accessing the device_control which will be deprecated soon

Signed-off-by: Vinod Koul <[email protected]>
---
drivers/spi/spi-dw-mid.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-dw-mid.c b/drivers/spi/spi-dw-mid.c
index 6d207af..6c8ad64 100644
--- a/drivers/spi/spi-dw-mid.c
+++ b/drivers/spi/spi-dw-mid.c
@@ -139,8 +139,7 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change)
txconf.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
txconf.device_fc = false;

- txchan->device->device_control(txchan, DMA_SLAVE_CONFIG,
- (unsigned long) &txconf);
+ dmaengine_slave_config(txchan, &txconf);

memset(&dws->tx_sgl, 0, sizeof(dws->tx_sgl));
dws->tx_sgl.dma_address = dws->tx_dma;
@@ -162,8 +161,7 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change)
rxconf.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
rxconf.device_fc = false;

- rxchan->device->device_control(rxchan, DMA_SLAVE_CONFIG,
- (unsigned long) &rxconf);
+ dmaengine_slave_config(txchan, &rxconf);

memset(&dws->rx_sgl, 0, sizeof(dws->rx_sgl));
dws->rx_sgl.dma_address = dws->rx_dma;
--
1.7.0.4

2014-10-11 16:15:37

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 12/12] video: mx3fb: use dmaengine_terminate_all() API

The drivers should use dmaengine_terminate_all() API instead of
accessing the device_control which will be deprecated soon

Signed-off-by: Vinod Koul <[email protected]>
---
drivers/video/fbdev/mx3fb.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c
index c645a0a..cdbc93a 100644
--- a/drivers/video/fbdev/mx3fb.c
+++ b/drivers/video/fbdev/mx3fb.c
@@ -461,8 +461,7 @@ static void sdc_disable_channel(struct mx3fb_info *mx3_fbi)

spin_unlock_irqrestore(&mx3fb->lock, flags);

- mx3_fbi->txd->chan->device->device_control(mx3_fbi->txd->chan,
- DMA_TERMINATE_ALL, 0);
+ dmaengine_terminate_all(mx3_fbi->txd->chan);
mx3_fbi->txd = NULL;
mx3_fbi->cookie = -EINVAL;
}
--
1.7.0.4

2014-10-11 16:15:27

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 09/12] serial: sh-sci: use dmaengine_terminate_all() API

The drivers should use dmaengine_terminate_all() API instead of
accessing the device_control which will be deprecated soon

Signed-off-by: Vinod Koul <[email protected]>
---
drivers/tty/serial/sh-sci.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 3081e46..eb17c71 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1403,7 +1403,7 @@ static void work_fn_rx(struct work_struct *work)
unsigned long flags;
int count;

- chan->device->device_control(chan, DMA_TERMINATE_ALL, 0);
+ dmaengine_terminate_all(chan);
dev_dbg(port->dev, "Read %zu bytes with cookie %d\n",
sh_desc->partial, sh_desc->cookie);

--
1.7.0.4

2014-10-11 16:16:06

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 11/12] ASoC: txx9: use dmaengine_terminate_all() API

The drivers should use dmaengine_terminate_all() API instead of
accessing the device_control which will be deprecated soon

Signed-off-by: Vinod Koul <[email protected]>
---
sound/soc/txx9/txx9aclc.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/sound/soc/txx9/txx9aclc.c b/sound/soc/txx9/txx9aclc.c
index f0829de..3b122cd 100644
--- a/sound/soc/txx9/txx9aclc.c
+++ b/sound/soc/txx9/txx9aclc.c
@@ -160,7 +160,7 @@ static void txx9aclc_dma_tasklet(unsigned long data)
void __iomem *base = drvdata->base;

spin_unlock_irqrestore(&dmadata->dma_lock, flags);
- chan->device->device_control(chan, DMA_TERMINATE_ALL, 0);
+ dmaengine_terminate_all(chan);
/* first time */
for (i = 0; i < NR_DMA_CHAIN; i++) {
desc = txx9aclc_dma_submit(dmadata,
@@ -266,7 +266,7 @@ static int txx9aclc_pcm_close(struct snd_pcm_substream *substream)
struct dma_chan *chan = dmadata->dma_chan;

dmadata->frag_count = -1;
- chan->device->device_control(chan, DMA_TERMINATE_ALL, 0);
+ dmaengine_terminate_all(chan);
return 0;
}

@@ -398,8 +398,7 @@ static int txx9aclc_pcm_remove(struct snd_soc_platform *platform)
struct dma_chan *chan = dmadata->dma_chan;
if (chan) {
dmadata->frag_count = -1;
- chan->device->device_control(chan,
- DMA_TERMINATE_ALL, 0);
+ dmaengine_terminate_all(chan);
dma_release_channel(chan);
}
dev->dmadata[i].dma_chan = NULL;
--
1.7.0.4

2014-10-11 16:15:25

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 10/12] usb: musb: ux500_dma: use dmaengine_xxx() APIs

The drivers should use dmaengine_terminate_all() or dmaengine_slave_config()
API instead of accessing the device_control which will be deprecated soon

Signed-off-by: Vinod Koul <[email protected]>
---
drivers/usb/musb/ux500_dma.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c
index 9aad00f..874833d 100644
--- a/drivers/usb/musb/ux500_dma.c
+++ b/drivers/usb/musb/ux500_dma.c
@@ -121,8 +121,7 @@ static bool ux500_configure_channel(struct dma_channel *channel,
slave_conf.dst_maxburst = 16;
slave_conf.device_fc = false;

- dma_chan->device->device_control(dma_chan, DMA_SLAVE_CONFIG,
- (unsigned long) &slave_conf);
+ dmaengine_slave_config(dma_chan, &slave_conf);

dma_desc = dmaengine_prep_slave_sg(dma_chan, &sg, 1, direction,
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
@@ -246,9 +245,7 @@ static int ux500_dma_channel_abort(struct dma_channel *channel)
musb_writew(epio, MUSB_RXCSR, csr);
}

- ux500_channel->dma_chan->device->
- device_control(ux500_channel->dma_chan,
- DMA_TERMINATE_ALL, 0);
+ dmaengine_terminate_all(ux500_channel->dma_chan);
channel->status = MUSB_DMA_STATUS_FREE;
}
return 0;
--
1.7.0.4

2014-10-11 16:15:15

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 06/12] net: ks8842: use dmaengine_terminate_all() API

The drivers should use dmaengine_terminate_all() API instead of
accessing the device_control which will be deprecated soon

Signed-off-by: Vinod Koul <[email protected]>
---
drivers/net/ethernet/micrel/ks8842.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/micrel/ks8842.c b/drivers/net/ethernet/micrel/ks8842.c
index 822616e..0c33b92 100644
--- a/drivers/net/ethernet/micrel/ks8842.c
+++ b/drivers/net/ethernet/micrel/ks8842.c
@@ -875,13 +875,11 @@ static void ks8842_stop_dma(struct ks8842_adapter *adapter)

tx_ctl->adesc = NULL;
if (tx_ctl->chan)
- tx_ctl->chan->device->device_control(tx_ctl->chan,
- DMA_TERMINATE_ALL, 0);
+ dmaengine_terminate_all(tx_ctl->chan);

rx_ctl->adesc = NULL;
if (rx_ctl->chan)
- rx_ctl->chan->device->device_control(rx_ctl->chan,
- DMA_TERMINATE_ALL, 0);
+ dmaengine_terminate_all(rx_ctl->chan);

if (sg_dma_address(&rx_ctl->sg))
dma_unmap_single(adapter->dev, sg_dma_address(&rx_ctl->sg),
--
1.7.0.4

2014-10-11 16:21:34

by Lars-Peter Clausen

[permalink] [raw]
Subject: Re: [PATCH 11/12] ASoC: txx9: use dmaengine_terminate_all() API

On 10/11/2014 05:40 PM, Vinod Koul wrote:
> The drivers should use dmaengine_terminate_all() API instead of
> accessing the device_control which will be deprecated soon

I already send a similar patch a while ago. It is on it's way into 3.18.

>
> Signed-off-by: Vinod Koul <[email protected]>

2014-10-11 16:28:17

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH 11/12] ASoC: txx9: use dmaengine_terminate_all() API

On Sat, Oct 11, 2014 at 06:21:47PM +0200, Lars-Peter Clausen wrote:
> On 10/11/2014 05:40 PM, Vinod Koul wrote:
> >The drivers should use dmaengine_terminate_all() API instead of
> >accessing the device_control which will be deprecated soon
>
> I already send a similar patch a while ago. It is on it's way into 3.18.
I will drop this one then

I did grep the linux-next when I started on this and found no reductions
from what I had in dmaengine-next

--
~Vinod

2014-10-11 17:19:42

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH 05/12] mtd: sh_flctl: use dmaengine_terminate_all() API

On Saturday 11 October 2014 21:10:33 Vinod Koul wrote:
> The drivers should use dmaengine_terminate_all() API instead of
> accessing the device_control which will be deprecated soon
>
> Signed-off-by: Vinod Koul <[email protected]>

Acked-by: Laurent Pinchart <[email protected]>

> ---
> drivers/mtd/nand/sh_flctl.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c
> index c067023..0ed7c60 100644
> --- a/drivers/mtd/nand/sh_flctl.c
> +++ b/drivers/mtd/nand/sh_flctl.c
> @@ -395,7 +395,7 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl
> *flctl, unsigned long *buf, msecs_to_jiffies(3000));
>
> if (ret <= 0) {
> - chan->device->device_control(chan, DMA_TERMINATE_ALL, 0);
> + dmaengine_terminate_all(chan);
> dev_err(&flctl->pdev->dev, "wait_for_completion_timeout\n");
> }

--
Regards,

Laurent Pinchart

2014-10-11 20:22:34

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 09/12] serial: sh-sci: use dmaengine_terminate_all() API

On Sat, Oct 11, 2014 at 09:10:37PM +0530, Vinod Koul wrote:
> The drivers should use dmaengine_terminate_all() API instead of
> accessing the device_control which will be deprecated soon
>
> Signed-off-by: Vinod Koul <[email protected]>

Acked-by: Greg Kroah-Hartman <[email protected]>

2014-10-11 20:22:54

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 10/12] usb: musb: ux500_dma: use dmaengine_xxx() APIs

On Sat, Oct 11, 2014 at 09:10:38PM +0530, Vinod Koul wrote:
> The drivers should use dmaengine_terminate_all() or dmaengine_slave_config()
> API instead of accessing the device_control which will be deprecated soon
>
> Signed-off-by: Vinod Koul <[email protected]>

Acked-by: Greg Kroah-Hartman <[email protected]>

2014-10-12 00:46:03

by Felipe Balbi

[permalink] [raw]
Subject: Re: [PATCH 10/12] usb: musb: ux500_dma: use dmaengine_xxx() APIs

Hi,

On Sat, Oct 11, 2014 at 09:10:38PM +0530, Vinod Koul wrote:
> The drivers should use dmaengine_terminate_all() or dmaengine_slave_config()
> API instead of accessing the device_control which will be deprecated soon
>
> Signed-off-by: Vinod Koul <[email protected]>

awesome. It looks like it doesn't have a direct dependency with the rest
of the series, so I'll take this through my tree with Greg's ack, unless
you shout ;-)

--
balbi


Attachments:
(No filename) (446.00 B)
signature.asc (819.00 B)
Digital signature
Download all attachments

2014-10-12 20:06:11

by Nicolas Ferre

[permalink] [raw]
Subject: Re: [PATCH 07/12] spi/atmel: use dmaengine_terminate_all() API

On 11/10/2014 17:40, Vinod Koul :
> The drivers should use dmaengine_terminate_all() API instead of
> accessing the device_control which will be deprecated soon
>
> Signed-off-by: Vinod Koul <[email protected]>

sure:
Acked-by: Nicolas Ferre <[email protected]>

Thanks Vinod.

Bye,

> ---
> drivers/spi/spi-atmel.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
> index 113c83f..649dcb5 100644
> --- a/drivers/spi/spi-atmel.c
> +++ b/drivers/spi/spi-atmel.c
> @@ -482,11 +482,9 @@ error:
> static void atmel_spi_stop_dma(struct atmel_spi *as)
> {
> if (as->dma.chan_rx)
> - as->dma.chan_rx->device->device_control(as->dma.chan_rx,
> - DMA_TERMINATE_ALL, 0);
> + dmaengine_terminate_all(as->dma.chan_rx);
> if (as->dma.chan_tx)
> - as->dma.chan_tx->device->device_control(as->dma.chan_tx,
> - DMA_TERMINATE_ALL, 0);
> + dmaengine_terminate_all(as->dma.chan_tx);
> }
>
> static void atmel_spi_release_dma(struct atmel_spi *as)
>


--
Nicolas Ferre

2014-10-13 02:47:29

by Viresh Kumar

[permalink] [raw]
Subject: Re: [PATCH 01/12] pata_arasan_cf: use dmaengine_terminate_all() API

On Sat, Oct 11, 2014 at 9:10 PM, Vinod Koul <[email protected]> wrote:
> The drivers should use dmaengine_terminate_all() API instead of accessing
> the device_control which will be deprecated soon
>
> Signed-off-by: Vinod Koul <[email protected]>
> ---
> drivers/ata/pata_arasan_cf.c | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
> index 4edb1a8..38216b9 100644
> --- a/drivers/ata/pata_arasan_cf.c
> +++ b/drivers/ata/pata_arasan_cf.c
> @@ -420,7 +420,7 @@ dma_xfer(struct arasan_cf_dev *acdev, dma_addr_t src, dma_addr_t dest, u32 len)
>
> /* Wait for DMA to complete */
> if (!wait_for_completion_timeout(&acdev->dma_completion, TIMEOUT)) {
> - chan->device->device_control(chan, DMA_TERMINATE_ALL, 0);
> + dmaengine_terminate_all(chan);
> dev_err(acdev->host->dev, "wait_for_completion_timeout\n");
> return -ETIMEDOUT;
> }
> @@ -928,8 +928,7 @@ static int arasan_cf_suspend(struct device *dev)
> struct arasan_cf_dev *acdev = host->ports[0]->private_data;
>
> if (acdev->dma_chan)
> - acdev->dma_chan->device->device_control(acdev->dma_chan,
> - DMA_TERMINATE_ALL, 0);
> + dmaengine_terminate_all(acdev->dma_chan);
>
> cf_exit(acdev);
> return ata_host_suspend(host, PMSG_SUSPEND);

Acked-by: Viresh Kumar <[email protected]>

2014-10-13 07:45:26

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 11/12] ASoC: txx9: use dmaengine_terminate_all() API

On Sat, Oct 11, 2014 at 09:24:11PM +0530, Vinod Koul wrote:
> On Sat, Oct 11, 2014 at 06:21:47PM +0200, Lars-Peter Clausen wrote:

> > I already send a similar patch a while ago. It is on it's way into 3.18.

> I will drop this one then

> I did grep the linux-next when I started on this and found no reductions
> from what I had in dmaengine-next

It's ff495d3a8ea4d (ASoC: txx9: Don't opencode DMAengine API calls) from
August which is in Linus' tree now.


Attachments:
(No filename) (459.00 B)
signature.asc (473.00 B)
Digital signature
Download all attachments

2014-10-13 10:30:49

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 07/12] spi/atmel: use dmaengine_terminate_all() API

On Sat, Oct 11, 2014 at 09:10:35PM +0530, Vinod Koul wrote:
> The drivers should use dmaengine_terminate_all() API instead of
> accessing the device_control which will be deprecated soon

Applied, thanks.


Attachments:
(No filename) (205.00 B)
signature.asc (473.00 B)
Digital signature
Download all attachments

2014-10-13 10:32:54

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 08/12] spi/spi-dw-mid.c: use dmaengine_slave_config() API

On Sat, Oct 11, 2014 at 09:10:36PM +0530, Vinod Koul wrote:
> The drivers should use dmaengine_slave_config() API instead of
> accessing the device_control which will be deprecated soon

Applied, thanks.


Attachments:
(No filename) (204.00 B)
signature.asc (473.00 B)
Digital signature
Download all attachments

2014-10-15 16:34:09

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH 00/12] dmaengine: remove users of device_control

On Sat, Oct 11, 2014 at 09:09:33PM +0530, Vinod Koul wrote:
> The recent discussion [1] on the API have resulted in moving away from
> device_control ioctl method to proper channel APIs.
> There are still few users on the device_control which should use the wrappers
> existing rather than access device_control.
> This will aid us in deprecating and removing device_control, possibly after
> the merge window.
>
> These can be merged thru respective subsystem tree or dmaengine tree. Either
> way please just let me know.

Applying to dmaengine-next with acks recived, dropping the ones which are
applied by respective folks

--
~Vinod

>
> Feng's kbuild has tested these as well [2]
>
> [1]: http://www.spinics.net/lists/dmaengine/msg02212.html
> [2]: http://git.infradead.org/users/vkoul/slave-dma.git/shortlog/refs/heads/topic/dma_control_cleanup
>
> Vinod Koul (12):
> pata_arasan_cf: use dmaengine_terminate_all() API
> dmaengine: coh901318: use dmaengine_terminate_all() API
> [media] V4L2: mx3_camer: use dmaengine_pause() API
> mtd: fsmc_nand: use dmaengine_terminate_all() API
> mtd: sh_flctl: use dmaengine_terminate_all() API
> net: ks8842: use dmaengine_terminate_all() API
> spi/atmel: use dmaengine_terminate_all() API
> spi/spi-dw-mid.c: use dmaengine_slave_config() API
> serial: sh-sci: use dmaengine_terminate_all() API
> usb: musb: ux500_dma: use dmaengine_xxx() APIs
> ASoC: txx9: use dmaengine_terminate_all() API
> video: mx3fb: use dmaengine_terminate_all() API
>
> drivers/ata/pata_arasan_cf.c | 5 ++---
> drivers/dma/coh901318.c | 2 +-
> drivers/media/platform/soc_camera/mx3_camera.c | 6 ++----
> drivers/mtd/nand/fsmc_nand.c | 2 +-
> drivers/mtd/nand/sh_flctl.c | 2 +-
> drivers/net/ethernet/micrel/ks8842.c | 6 ++----
> drivers/spi/spi-atmel.c | 6 ++----
> drivers/spi/spi-dw-mid.c | 6 ++----
> drivers/tty/serial/sh-sci.c | 2 +-
> drivers/usb/musb/ux500_dma.c | 7 ++-----
> drivers/video/fbdev/mx3fb.c | 3 +--
> sound/soc/txx9/txx9aclc.c | 7 +++----
> 12 files changed, 20 insertions(+), 34 deletions(-)
>
> --
> To unsubscribe from this list: send the line "unsubscribe dmaengine" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

--

2014-10-16 19:41:15

by Guennadi Liakhovetski

[permalink] [raw]
Subject: Re: [PATCH 03/12] [media] V4L2: mx3_camer: use dmaengine_pause() API

On Sat, 11 Oct 2014, Vinod Koul wrote:

> The drivers should use dmaengine_pause() API instead of
> accessing the device_control which will be deprecated soon
>
> Signed-off-by: Vinod Koul <[email protected]>

Acked-by: Guennadi Liakhovetski <[email protected]>

Thanks
Guennadi

> ---
> drivers/media/platform/soc_camera/mx3_camera.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/platform/soc_camera/mx3_camera.c b/drivers/media/platform/soc_camera/mx3_camera.c
> index 83315df..7696a87 100644
> --- a/drivers/media/platform/soc_camera/mx3_camera.c
> +++ b/drivers/media/platform/soc_camera/mx3_camera.c
> @@ -415,10 +415,8 @@ static void mx3_stop_streaming(struct vb2_queue *q)
> struct mx3_camera_buffer *buf, *tmp;
> unsigned long flags;
>
> - if (ichan) {
> - struct dma_chan *chan = &ichan->dma_chan;
> - chan->device->device_control(chan, DMA_PAUSE, 0);
> - }
> + if (ichan)
> + dmaengine_pause(&ichan->dma_chan);
>
> spin_lock_irqsave(&mx3_cam->lock, flags);
>
> --
> 1.7.0.4
>

2014-10-27 16:43:22

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 02/12] dmaengine: coh901318: use dmaengine_terminate_all() API

On Sat, Oct 11, 2014 at 5:40 PM, Vinod Koul <[email protected]> wrote:

> The drivers should use dmaengine_terminate_all() API instead of accessing
> the device_control which will be deprecated soon
>
> Signed-off-by: Vinod Koul <[email protected]>

Acked-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij

2014-10-27 16:43:50

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 04/12] mtd: fsmc_nand: use dmaengine_terminate_all() API

On Sat, Oct 11, 2014 at 5:40 PM, Vinod Koul <[email protected]> wrote:

> The drivers should use dmaengine_terminate_all() API instead of
> accessing the device_control which will be deprecated soon
>
> Signed-off-by: Vinod Koul <[email protected]>

Acked-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij