All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] dma: Add a PAUSE_RESUME capability
@ 2013-05-29 11:42 Lars-Peter Clausen
       [not found] ` <1369827743-5533-1-git-send-email-lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
  2013-05-30 16:49 ` [PATCH 1/2] dma: Add a PAUSE_RESUME capability Vinod Koul
  0 siblings, 2 replies; 5+ messages in thread
From: Lars-Peter Clausen @ 2013-05-29 11:42 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, Scott Jiang, Steven Miao
  Cc: uclinux-dist-devel, alsa-devel, Lars-Peter Clausen

Add a capability which allows dmaengine consumers to query whether a dmaengine
controller supports the DMA_PAUSE and DMA_RESUME commands. Sometimes a user of
the dmaengine API needs to know in advance if a channel will support
pause/resume. E.g. in ALSA the information whether it is possible to
pause/resume a audio stream or whether it is necessary to abort and restart the
stream is communicated to userspace so it can act accordingly.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 include/linux/dmaengine.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 96d3e4a..ad98dfb 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -74,6 +74,7 @@ enum dma_transaction_type {
 	DMA_SLAVE,
 	DMA_CYCLIC,
 	DMA_INTERLEAVE,
+	DMA_PAUSE_RESUME,
 /* last transaction type for creation of the capabilities mask */
 	DMA_TX_TYPE_END,
 };
-- 
1.8.0

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

* [PATCH 2/2] dma: Set PAUSE_RESUME capability for drivers which support it
       [not found] ` <1369827743-5533-1-git-send-email-lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
@ 2013-05-29 11:42   ` Lars-Peter Clausen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars-Peter Clausen @ 2013-05-29 11:42 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, Scott Jiang, Steven Miao
  Cc: uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw

Set the newly introduced PAUSE_RESUME capability for driver which support
pausing/resuming the DMA stream.

Signed-off-by: Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
---
 drivers/dma/amba-pl08x.c    | 1 +
 drivers/dma/at_hdmac.c      | 1 +
 drivers/dma/coh901318.c     | 1 +
 drivers/dma/dw_dmac.c       | 1 +
 drivers/dma/ipu/ipu_idmac.c | 1 +
 drivers/dma/mmp_tdma.c      | 1 +
 drivers/dma/mxs-dma.c       | 1 +
 drivers/dma/omap-dma.c      | 1 +
 drivers/dma/sa11x0-dma.c    | 1 +
 drivers/dma/sirf-dma.c      | 1 +
 drivers/dma/ste_dma40.c     | 1 +
 11 files changed, 11 insertions(+)

diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index 8bad254..fa25199 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -1873,6 +1873,7 @@ static int pl08x_probe(struct amba_device *adev, const struct amba_id *id)
 
 	/* Initialize slave engine */
 	dma_cap_set(DMA_SLAVE, pl08x->slave.cap_mask);
+	dma_cap_set(DMA_PAUSE_RESUME, pl08x->slave.cap_mask);
 	pl08x->slave.dev = &adev->dev;
 	pl08x->slave.device_alloc_chan_resources = pl08x_alloc_chan_resources;
 	pl08x->slave.device_free_chan_resources = pl08x_free_chan_resources;
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 5ce8936..d7a44a8 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -1431,6 +1431,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
 	dma_cap_set(DMA_MEMCPY, at91sam9rl_config.cap_mask);
 	dma_cap_set(DMA_MEMCPY, at91sam9g45_config.cap_mask);
 	dma_cap_set(DMA_SLAVE, at91sam9g45_config.cap_mask);
+	dma_cap_set(DMA_PAUSE_RESUME, at91sam9g45_config.cap_mask);
 
 	/* get DMA parameters from controller type */
 	plat_dat = at_dma_get_driver_data(pdev);
diff --git a/drivers/dma/coh901318.c b/drivers/dma/coh901318.c
index 3b23061..95ef299 100644
--- a/drivers/dma/coh901318.c
+++ b/drivers/dma/coh901318.c
@@ -2697,6 +2697,7 @@ static int __init coh901318_probe(struct platform_device *pdev)
 
 	dma_cap_zero(base->dma_slave.cap_mask);
 	dma_cap_set(DMA_SLAVE, base->dma_slave.cap_mask);
+	dma_cap_set(DMA_PAUSE_RESUME, base->dma_slave.cap_mask);
 
 	base->dma_slave.device_alloc_chan_resources = coh901318_alloc_chan_resources;
 	base->dma_slave.device_free_chan_resources = coh901318_free_chan_resources;
diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
index 2e5deaa..23d5ea5f 100644
--- a/drivers/dma/dw_dmac.c
+++ b/drivers/dma/dw_dmac.c
@@ -1832,6 +1832,7 @@ static int dw_probe(struct platform_device *pdev)
 
 	dma_cap_set(DMA_MEMCPY, dw->dma.cap_mask);
 	dma_cap_set(DMA_SLAVE, dw->dma.cap_mask);
+	dma_cap_set(DMA_PAUSE_RESUME, dw->dma.cap_mask);
 	if (pdata->is_private)
 		dma_cap_set(DMA_PRIVATE, dw->dma.cap_mask);
 	dw->dma.dev = &pdev->dev;
diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c
index d39c2cd..5a4eabb 100644
--- a/drivers/dma/ipu/ipu_idmac.c
+++ b/drivers/dma/ipu/ipu_idmac.c
@@ -1607,6 +1607,7 @@ static int __init ipu_idmac_init(struct ipu *ipu)
 
 	dma_cap_set(DMA_SLAVE, dma->cap_mask);
 	dma_cap_set(DMA_PRIVATE, dma->cap_mask);
+	dma_cap_set(DMA_PAUSE_RESUME, dma->cap_mask);
 
 	/* Compulsory common fields */
 	dma->dev				= ipu->dev;
diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c
index 43d5a6c..a296aee 100644
--- a/drivers/dma/mmp_tdma.c
+++ b/drivers/dma/mmp_tdma.c
@@ -572,6 +572,7 @@ static int mmp_tdma_probe(struct platform_device *pdev)
 
 	dma_cap_set(DMA_SLAVE, tdev->device.cap_mask);
 	dma_cap_set(DMA_CYCLIC, tdev->device.cap_mask);
+	dma_cap_set(DMA_PAUSE_RESUME, tdev->device.cap_mask);
 	tdev->device.dev = &pdev->dev;
 	tdev->device.device_alloc_chan_resources =
 					mmp_tdma_alloc_chan_resources;
diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index 7195930..19fe380 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -753,6 +753,7 @@ static int __init mxs_dma_probe(struct platform_device *pdev)
 
 	dma_cap_set(DMA_SLAVE, mxs_dma->dma_device.cap_mask);
 	dma_cap_set(DMA_CYCLIC, mxs_dma->dma_device.cap_mask);
+	dma_cap_set(DMA_PAUSE_RESUME, mxs_dma->dma_device.cap_mask);
 
 	INIT_LIST_HEAD(&mxs_dma->dma_device.channels);
 
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index ec3fc4f..fe8643b 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -608,6 +608,7 @@ static int omap_dma_probe(struct platform_device *pdev)
 
 	dma_cap_set(DMA_SLAVE, od->ddev.cap_mask);
 	dma_cap_set(DMA_CYCLIC, od->ddev.cap_mask);
+	dma_cap_set(DMA_PAUSE_RESUME, od->ddev.cap_mask);
 	od->ddev.device_alloc_chan_resources = omap_dma_alloc_chan_resources;
 	od->ddev.device_free_chan_resources = omap_dma_free_chan_resources;
 	od->ddev.device_tx_status = omap_dma_tx_status;
diff --git a/drivers/dma/sa11x0-dma.c b/drivers/dma/sa11x0-dma.c
index 461a91a..81eefb3 100644
--- a/drivers/dma/sa11x0-dma.c
+++ b/drivers/dma/sa11x0-dma.c
@@ -942,6 +942,7 @@ static int sa11x0_dma_probe(struct platform_device *pdev)
 
 	dma_cap_set(DMA_SLAVE, d->slave.cap_mask);
 	dma_cap_set(DMA_CYCLIC, d->slave.cap_mask);
+	dma_cap_set(DMA_PAUSE_RESUME, d->slave.cap_mask);
 	d->slave.device_prep_slave_sg = sa11x0_dma_prep_slave_sg;
 	d->slave.device_prep_dma_cyclic = sa11x0_dma_prep_dma_cyclic;
 	ret = sa11x0_dma_init_dmadev(&d->slave, &pdev->dev);
diff --git a/drivers/dma/sirf-dma.c b/drivers/dma/sirf-dma.c
index 1765a0a..163e8e5 100644
--- a/drivers/dma/sirf-dma.c
+++ b/drivers/dma/sirf-dma.c
@@ -687,6 +687,7 @@ static int sirfsoc_dma_probe(struct platform_device *op)
 	dma_cap_set(DMA_CYCLIC, dma->cap_mask);
 	dma_cap_set(DMA_INTERLEAVE, dma->cap_mask);
 	dma_cap_set(DMA_PRIVATE, dma->cap_mask);
+	dma_cap_set(DMA_PAUSE_RESUME, dma->cap_mask);
 
 	for (i = 0; i < dma->chancnt; i++) {
 		schan = &sdma->channels[i];
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 71bf4ec..c1dc544 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -2918,6 +2918,7 @@ static int __init d40_dmaengine_init(struct d40_base *base,
 	dma_cap_zero(base->dma_slave.cap_mask);
 	dma_cap_set(DMA_SLAVE, base->dma_slave.cap_mask);
 	dma_cap_set(DMA_CYCLIC, base->dma_slave.cap_mask);
+	dma_cap_set(DMA_PAUSE_RESUME, base->dma_slave.cap_mask);
 
 	d40_ops_init(base, &base->dma_slave);
 
-- 
1.8.0

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

* Re: [PATCH 1/2] dma: Add a PAUSE_RESUME capability
  2013-05-29 11:42 [PATCH 1/2] dma: Add a PAUSE_RESUME capability Lars-Peter Clausen
       [not found] ` <1369827743-5533-1-git-send-email-lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
@ 2013-05-30 16:49 ` Vinod Koul
  2013-05-30 19:10   ` [alsa-devel] " Lars-Peter Clausen
  2013-06-01 19:00   ` Mark Brown
  1 sibling, 2 replies; 5+ messages in thread
From: Vinod Koul @ 2013-05-30 16:49 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Scott Jiang, alsa-devel, Steven Miao, vinod.koul, Liam Girdwood,
	Mark Brown, uclinux-dist-devel

On Wed, 2013-05-29 at 13:42 +0200, Lars-Peter Clausen wrote:
> Add a capability which allows dmaengine consumers to query whether a dmaengine
> controller supports the DMA_PAUSE and DMA_RESUME commands. Sometimes a user of
> the dmaengine API needs to know in advance if a channel will support
> pause/resume. E.g. in ALSA the information whether it is possible to
> pause/resume a audio stream or whether it is necessary to abort and restart the
> stream is communicated to userspace so it can act accordingly.
- This mail-list is not correct for this patch
- use get_maintainer.pl, if you dont know but you already know!
- always CC maintainers

the enum dma_transaction_type reports what kind of transactions DMA
controller is capable of. This is not for capabilities of a given
transaction type, so this approach is not right.

Unfortunately, this is not supported by dmaengine atm. We had discussed
this in last plumbers, and discussion with Matt was to add capability
API (at least for slave usages). The work from Matt had reached a good
point but unfortunately didn't reach its conclusion. [1]

Let me resurrect those patches and add the pause, resume query to it in
more generic way

--
~Vinod

[1]: https://patchwork.kernel.org/patch/2094891/

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

* Re: [alsa-devel] [PATCH 1/2] dma: Add a PAUSE_RESUME capability
  2013-05-30 16:49 ` [PATCH 1/2] dma: Add a PAUSE_RESUME capability Vinod Koul
@ 2013-05-30 19:10   ` Lars-Peter Clausen
  2013-06-01 19:00   ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Lars-Peter Clausen @ 2013-05-30 19:10 UTC (permalink / raw)
  To: Vinod Koul; +Cc: linux kernel, vinod.koul

On 05/30/2013 06:49 PM, Vinod Koul wrote:
> On Wed, 2013-05-29 at 13:42 +0200, Lars-Peter Clausen wrote:
>> Add a capability which allows dmaengine consumers to query whether a dmaengine
>> controller supports the DMA_PAUSE and DMA_RESUME commands. Sometimes a user of
>> the dmaengine API needs to know in advance if a channel will support
>> pause/resume. E.g. in ALSA the information whether it is possible to
>> pause/resume a audio stream or whether it is necessary to abort and restart the
>> stream is communicated to userspace so it can act accordingly.
> - This mail-list is not correct for this patch
> - use get_maintainer.pl, if you dont know but you already know!
> - always CC maintainers

Hm, I have no idea what happened with the Cc list. I might have hit the up key
one time to many after --dry-run, since this is the Cc list of a different
patch series.

> 
> the enum dma_transaction_type reports what kind of transactions DMA
> controller is capable of. This is not for capabilities of a given
> transaction type, so this approach is not right.

hm, ok.
> 
> Unfortunately, this is not supported by dmaengine atm. We had discussed
> this in last plumbers, and discussion with Matt was to add capability
> API (at least for slave usages). The work from Matt had reached a good
> point but unfortunately didn't reach its conclusion. [1]
> 
> Let me resurrect those patches and add the pause, resume query to it in
> more generic way

I've pinged Matt about these patches yesterday or so. He has been rather quite
lately, maybe he's been sucked into the Linaro blackhole.

- Lars


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

* Re: [PATCH 1/2] dma: Add a PAUSE_RESUME capability
  2013-05-30 16:49 ` [PATCH 1/2] dma: Add a PAUSE_RESUME capability Vinod Koul
  2013-05-30 19:10   ` [alsa-devel] " Lars-Peter Clausen
@ 2013-06-01 19:00   ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2013-06-01 19:00 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Scott Jiang, Lars-Peter Clausen, alsa-devel, Steven Miao,
	vinod.koul, Liam Girdwood, uclinux-dist-devel


[-- Attachment #1.1: Type: text/plain, Size: 584 bytes --]

On Thu, May 30, 2013 at 10:19:35PM +0530, Vinod Koul wrote:

> - This mail-list is not correct for this patch
> - use get_maintainer.pl, if you dont know but you already know!

These two bits of advice unfortunately conflict with each other a bit if
one of the lists involved is lkml - since lkml isn't listed in
MAINTAINERS and is always added implicitly get_maintainers won't tell
you if it is actually a list you should be using as opposed to just
something that it shoves on the end of the list of addreses (which most
of the time means it's not actually sensible to send there).

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

end of thread, other threads:[~2013-06-01 19:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-29 11:42 [PATCH 1/2] dma: Add a PAUSE_RESUME capability Lars-Peter Clausen
     [not found] ` <1369827743-5533-1-git-send-email-lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2013-05-29 11:42   ` [PATCH 2/2] dma: Set PAUSE_RESUME capability for drivers which support it Lars-Peter Clausen
2013-05-30 16:49 ` [PATCH 1/2] dma: Add a PAUSE_RESUME capability Vinod Koul
2013-05-30 19:10   ` [alsa-devel] " Lars-Peter Clausen
2013-06-01 19:00   ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.