alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] dmaengine: Fix compillation issues in device_prep_dma_cyclic()
       [not found] <20120924133923.130c4db72aa8105cb5647d7a@canb.auug.org.au>
@ 2012-09-24  7:58 ` Peter Ujfalusi
  2012-09-24  7:58   ` [PATCH 1/2] dmaengine: Add flags parameter to dmaengine_prep_dma_cyclic() Peter Ujfalusi
                     ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2012-09-24  7:58 UTC (permalink / raw)
  To: Stephen Rothwell, Mark Brown, Liam Girdwood, Takashi Iwai
  Cc: alsa-devel, linux-next, linux-kernel, Vinod Koul, Kukjin Kim

Hello,

The reason for the breakage is the patch 1 got lost somewhere in the process.
I also greped the whole tree for device_prep_dma_cyclic() and the second patch
is the result of that.

PS: I did build tested the series on ARM (OMAP), x86_32, x86_64 but not for ppc
for sure.

Regards,
Peter
---
Peter Ujfalusi (2):
  dmaengine: Add flags parameter to dmaengine_prep_dma_cyclic()
  ARM: SAMSUNG: dma-ops: Fix dmaengine_prep_dma_cyclic() parameter list

 arch/arm/plat-samsung/dma-ops.c | 3 ++-
 include/linux/dmaengine.h       | 3 ++-
 sound/soc/soc-dmaengine-pcm.c   | 6 +++++-
 3 files changed, 9 insertions(+), 3 deletions(-)

-- 
1.7.12

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

* [PATCH 1/2] dmaengine: Add flags parameter to dmaengine_prep_dma_cyclic()
  2012-09-24  7:58 ` [PATCH 0/2] dmaengine: Fix compillation issues in device_prep_dma_cyclic() Peter Ujfalusi
@ 2012-09-24  7:58   ` Peter Ujfalusi
  2012-09-24  7:58   ` [PATCH 2/2] ARM: SAMSUNG: dma-ops: Fix dmaengine_prep_dma_cyclic() parameter list Peter Ujfalusi
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2012-09-24  7:58 UTC (permalink / raw)
  To: Stephen Rothwell, Mark Brown, Liam Girdwood, Takashi Iwai
  Cc: alsa-devel, linux-next, linux-kernel, Vinod Koul, Kukjin Kim,
	Lars-Peter Clausen

With this parameter added to dmaengine_prep_dma_cyclic() the API will be in
sync with other dmaengine_prep_*() functions.
The dmaengine_prep_dma_cyclic() function primarily used by audio for cyclic
transfer required by ALSA, we use the from audio to ask dma drivers to
suppress interrupts (if DMA_PREP_INTERRUPT is cleared) when it is supported
on the platform.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
CC: Lars-Peter Clausen <lars@metafoo.de>
---
 include/linux/dmaengine.h     | 3 ++-
 sound/soc/soc-dmaengine-pcm.c | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 09da4e5..d3201e4 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -653,7 +653,8 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_rio_sg(
 
 static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_cyclic(
 		struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
-		size_t period_len, enum dma_transfer_direction dir)
+		size_t period_len, enum dma_transfer_direction dir,
+		unsigned long flags)
 {
 	return chan->device->device_prep_dma_cyclic(chan, buf_addr, buf_len,
 						period_len, dir, flags, NULL);
diff --git a/sound/soc/soc-dmaengine-pcm.c b/sound/soc/soc-dmaengine-pcm.c
index 5df529e..bbc1257 100644
--- a/sound/soc/soc-dmaengine-pcm.c
+++ b/sound/soc/soc-dmaengine-pcm.c
@@ -140,14 +140,18 @@ static int dmaengine_pcm_prepare_and_submit(struct snd_pcm_substream *substream)
 	struct dma_chan *chan = prtd->dma_chan;
 	struct dma_async_tx_descriptor *desc;
 	enum dma_transfer_direction direction;
+	unsigned long flags = DMA_CTRL_ACK;
 
 	direction = snd_pcm_substream_to_dma_direction(substream);
 
+	if (!substream->runtime->no_period_wakeup)
+		flags |= DMA_PREP_INTERRUPT;
+
 	prtd->pos = 0;
 	desc = dmaengine_prep_dma_cyclic(chan,
 		substream->runtime->dma_addr,
 		snd_pcm_lib_buffer_bytes(substream),
-		snd_pcm_lib_period_bytes(substream), direction);
+		snd_pcm_lib_period_bytes(substream), direction, flags);
 
 	if (!desc)
 		return -ENOMEM;
-- 
1.7.12

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

* [PATCH 2/2] ARM: SAMSUNG: dma-ops: Fix dmaengine_prep_dma_cyclic() parameter list
  2012-09-24  7:58 ` [PATCH 0/2] dmaengine: Fix compillation issues in device_prep_dma_cyclic() Peter Ujfalusi
  2012-09-24  7:58   ` [PATCH 1/2] dmaengine: Add flags parameter to dmaengine_prep_dma_cyclic() Peter Ujfalusi
@ 2012-09-24  7:58   ` Peter Ujfalusi
  2012-09-24  8:17   ` [PATCH 0/2] dmaengine: Fix compillation issues in device_prep_dma_cyclic() Takashi Iwai
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2012-09-24  7:58 UTC (permalink / raw)
  To: Stephen Rothwell, Mark Brown, Liam Girdwood, Takashi Iwai
  Cc: alsa-devel, linux-next, linux-kernel, Vinod Koul, Kukjin Kim

There is a new flags parameter for the function.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 arch/arm/plat-samsung/dma-ops.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/plat-samsung/dma-ops.c b/arch/arm/plat-samsung/dma-ops.c
index c38d754..d088afa 100644
--- a/arch/arm/plat-samsung/dma-ops.c
+++ b/arch/arm/plat-samsung/dma-ops.c
@@ -91,7 +91,8 @@ static int samsung_dmadev_prepare(unsigned ch,
 		break;
 	case DMA_CYCLIC:
 		desc = dmaengine_prep_dma_cyclic(chan, param->buf,
-			param->len, param->period, param->direction);
+			param->len, param->period, param->direction,
+			DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 		break;
 	default:
 		dev_err(&chan->dev->device, "unsupported format\n");
-- 
1.7.12

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

* Re: [PATCH 0/2] dmaengine: Fix compillation issues in device_prep_dma_cyclic()
  2012-09-24  7:58 ` [PATCH 0/2] dmaengine: Fix compillation issues in device_prep_dma_cyclic() Peter Ujfalusi
  2012-09-24  7:58   ` [PATCH 1/2] dmaengine: Add flags parameter to dmaengine_prep_dma_cyclic() Peter Ujfalusi
  2012-09-24  7:58   ` [PATCH 2/2] ARM: SAMSUNG: dma-ops: Fix dmaengine_prep_dma_cyclic() parameter list Peter Ujfalusi
@ 2012-09-24  8:17   ` Takashi Iwai
  2012-09-24 18:08     ` Takashi Iwai
  2012-09-24  8:40   ` Vinod Koul
  2012-10-12 16:44   ` [alsa-devel] " Tabi Timur-B04825
  4 siblings, 1 reply; 8+ messages in thread
From: Takashi Iwai @ 2012-09-24  8:17 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Stephen Rothwell, Mark Brown, Liam Girdwood, alsa-devel,
	linux-next, linux-kernel, Vinod Koul, Kukjin Kim

At Mon, 24 Sep 2012 10:58:03 +0300,
Peter Ujfalusi wrote:
> 
> Hello,
> 
> The reason for the breakage is the patch 1 got lost somewhere in the process.
> I also greped the whole tree for device_prep_dma_cyclic() and the second patch
> is the result of that.
> 
> PS: I did build tested the series on ARM (OMAP), x86_32, x86_64 but not for ppc
> for sure.

Thanks!  I wait for Mark merging these to his tree for a while.

Mark, could you tell me when it's ready?  Since I'll be off from
tomorrow, I'd like to resolve sooner.


thanks,

Takashi


> 
> Regards,
> Peter
> ---
> Peter Ujfalusi (2):
>   dmaengine: Add flags parameter to dmaengine_prep_dma_cyclic()
>   ARM: SAMSUNG: dma-ops: Fix dmaengine_prep_dma_cyclic() parameter list
> 
>  arch/arm/plat-samsung/dma-ops.c | 3 ++-
>  include/linux/dmaengine.h       | 3 ++-
>  sound/soc/soc-dmaengine-pcm.c   | 6 +++++-
>  3 files changed, 9 insertions(+), 3 deletions(-)
> 
> -- 
> 1.7.12
> 

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

* Re: [PATCH 0/2] dmaengine: Fix compillation issues in device_prep_dma_cyclic()
  2012-09-24  7:58 ` [PATCH 0/2] dmaengine: Fix compillation issues in device_prep_dma_cyclic() Peter Ujfalusi
                     ` (2 preceding siblings ...)
  2012-09-24  8:17   ` [PATCH 0/2] dmaengine: Fix compillation issues in device_prep_dma_cyclic() Takashi Iwai
@ 2012-09-24  8:40   ` Vinod Koul
  2012-10-12 16:44   ` [alsa-devel] " Tabi Timur-B04825
  4 siblings, 0 replies; 8+ messages in thread
From: Vinod Koul @ 2012-09-24  8:40 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Stephen Rothwell, Mark Brown, Liam Girdwood, Takashi Iwai,
	alsa-devel, linux-next, linux-kernel, Kukjin Kim

On Mon, 2012-09-24 at 10:58 +0300, Peter Ujfalusi wrote:
> Hello,
> 
> The reason for the breakage is the patch 1 got lost somewhere in the process.
> I also greped the whole tree for device_prep_dma_cyclic() and the second patch
> is the result of that.
> 
> PS: I did build tested the series on ARM (OMAP), x86_32, x86_64 but not for ppc
> for sure.
I though patch 1 was part of the series Mark was supposed to apply.

Anyway both look fine to me so:
Both Acked-By: Vinod Koul <vinod.koul@linux.intel.com>

-- 
~Vinod

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

* Re: [PATCH 0/2] dmaengine: Fix compillation issues in device_prep_dma_cyclic()
  2012-09-24  8:17   ` [PATCH 0/2] dmaengine: Fix compillation issues in device_prep_dma_cyclic() Takashi Iwai
@ 2012-09-24 18:08     ` Takashi Iwai
  2012-09-25 11:19       ` Mark Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Takashi Iwai @ 2012-09-24 18:08 UTC (permalink / raw)
  To: Mark Brown
  Cc: Peter Ujfalusi, Stephen Rothwell, Liam Girdwood, alsa-devel,
	linux-next, linux-kernel, Vinod Koul, Kukjin Kim

At Mon, 24 Sep 2012 10:17:15 +0200,
Takashi Iwai wrote:
> 
> At Mon, 24 Sep 2012 10:58:03 +0300,
> Peter Ujfalusi wrote:
> > 
> > Hello,
> > 
> > The reason for the breakage is the patch 1 got lost somewhere in the process.
> > I also greped the whole tree for device_prep_dma_cyclic() and the second patch
> > is the result of that.
> > 
> > PS: I did build tested the series on ARM (OMAP), x86_32, x86_64 but not for ppc
> > for sure.
> 
> Thanks!  I wait for Mark merging these to his tree for a while.
> 
> Mark, could you tell me when it's ready?  Since I'll be off from
> tomorrow, I'd like to resolve sooner.

My time is up, so I merged Peter's two patches on the top of for-next
branch of sound git tree now.  Mark, please pull them to your tree if
needed.


thanks,

Takashi

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

* Re: [PATCH 0/2] dmaengine: Fix compillation issues in device_prep_dma_cyclic()
  2012-09-24 18:08     ` Takashi Iwai
@ 2012-09-25 11:19       ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2012-09-25 11:19 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Stephen Rothwell, alsa-devel, Kukjin Kim, Vinod Koul,
	linux-kernel, Peter Ujfalusi, linux-next, Liam Girdwood

On Mon, Sep 24, 2012 at 08:08:32PM +0200, Takashi Iwai wrote:
> At Mon, 24 Sep 2012 10:17:15 +0200,

> > Mark, could you tell me when it's ready?  Since I'll be off from
> > tomorrow, I'd like to resolve sooner.

> My time is up, so I merged Peter's two patches on the top of for-next
> branch of sound git tree now.  Mark, please pull them to your tree if
> needed.

Oh, well.  I was travelling for the entire time between Peter posting
the patches and you applying them :/

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

* Re: [alsa-devel] [PATCH 0/2] dmaengine: Fix compillation issues in device_prep_dma_cyclic()
  2012-09-24  7:58 ` [PATCH 0/2] dmaengine: Fix compillation issues in device_prep_dma_cyclic() Peter Ujfalusi
                     ` (3 preceding siblings ...)
  2012-09-24  8:40   ` Vinod Koul
@ 2012-10-12 16:44   ` Tabi Timur-B04825
  4 siblings, 0 replies; 8+ messages in thread
From: Tabi Timur-B04825 @ 2012-10-12 16:44 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Stephen Rothwell, Mark Brown, Liam Girdwood, Takashi Iwai,
	Vinod Koul, Kukjin Kim, alsa-devel@alsa-project.org,
	linux-next@vger.kernel.org, linux-kernel@vger.kernel.org

On Mon, Sep 24, 2012 at 2:58 AM, Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:

> PS: I did build tested the series on ARM (OMAP), x86_32, x86_64 but not for ppc
> for sure.

For the record, patch #1 fixes the build break on PowerPC.  Thanks.

-- 
Timur Tabi
Linux kernel developer at Freescale

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

end of thread, other threads:[~2012-10-12 16:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20120924133923.130c4db72aa8105cb5647d7a@canb.auug.org.au>
2012-09-24  7:58 ` [PATCH 0/2] dmaengine: Fix compillation issues in device_prep_dma_cyclic() Peter Ujfalusi
2012-09-24  7:58   ` [PATCH 1/2] dmaengine: Add flags parameter to dmaengine_prep_dma_cyclic() Peter Ujfalusi
2012-09-24  7:58   ` [PATCH 2/2] ARM: SAMSUNG: dma-ops: Fix dmaengine_prep_dma_cyclic() parameter list Peter Ujfalusi
2012-09-24  8:17   ` [PATCH 0/2] dmaengine: Fix compillation issues in device_prep_dma_cyclic() Takashi Iwai
2012-09-24 18:08     ` Takashi Iwai
2012-09-25 11:19       ` Mark Brown
2012-09-24  8:40   ` Vinod Koul
2012-10-12 16:44   ` [alsa-devel] " Tabi Timur-B04825

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