[alsa-devel] [PATCH 0/2] dmaengine: Fix compillation issues in device_prep_dma_cyclic()
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(-)
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;
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");
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
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
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 :/
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
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.
participants (5)
-
Mark Brown
-
Peter Ujfalusi
-
Tabi Timur-B04825
-
Takashi Iwai
-
Vinod Koul