2014-07-16 12:29:42

by Peter Ujfalusi

[permalink] [raw]
Subject: [PATCH 0/2] dma: edma: Allow to disable eDMA IRQ during cyclic transfer

Hi,

After this series clients can ask to not receive notifications after each period.
In this case we can disable the completion interrupt since the position reporting
does not rely on it for cyclic mode.
Patchset for ASoC part has been sent which allows users space to take adventage
of SNDRV_PCM_INFO_NO_PERIOD_WAKEUP:
[1] http://mailman.alsa-project.org/pipermail/alsa-devel/2014-July/078993.html

When both series applied on top of linux-next:

# cache the audio file in memory
cat some_music.mp3 > /dev/null
# start PA
pulseaudio -v
# in another terminal, play the music via PA
mplayer -ao pulse some_music.mp3
# yet another terminal to monitor the interrupts
watch cat /proc/interrupts
# note the non increasing number of edma interrupts ;)

Regards,
Peter
---
Peter Ujfalusi (2):
dma: edma: Update caps->residue_granularity to match with reality
dma: edma: Support to suppress the period interrupts in cyclic mode

drivers/dma/edma.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

--
2.0.0


2014-07-16 12:29:38

by Peter Ujfalusi

[permalink] [raw]
Subject: [PATCH 2/2] dma: edma: Support to suppress the period interrupts in cyclic mode

If the client (audio) does not request interrupts for every period we can
disable them.
With updated audio driver stack we can play audio w/o the need to process
any edma interrupts.

Signed-off-by: Peter Ujfalusi <[email protected]>
---
drivers/dma/edma.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index d5017abcf7cb..69f1f5250120 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -723,10 +723,10 @@ static struct dma_async_tx_descriptor *edma_prep_dma_cyclic(
edesc->absync = ret;

/*
- * Enable interrupts for every period because callback
- * has to be called for every period.
+ * Enable period interrupt only if it is requested
*/
- edesc->pset[i].param.opt |= TCINTEN;
+ if (tx_flags & DMA_PREP_INTERRUPT)
+ edesc->pset[i].param.opt |= TCINTEN;
}

/* Place the cyclic channel to highest priority queue */
--
2.0.0

2014-07-16 12:30:25

by Peter Ujfalusi

[permalink] [raw]
Subject: [PATCH 1/2] dma: edma: Update caps->residue_granularity to match with reality

The edma can report accurate DMA position so update the residue_granularity
to DMA_RESIDUE_GRANULARITY_BURST.

Signed-off-by: Peter Ujfalusi <[email protected]>
---
drivers/dma/edma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index fe55f78ea137..d5017abcf7cb 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -1001,7 +1001,7 @@ static int edma_dma_device_slave_caps(struct dma_chan *dchan,
caps->directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
caps->cmd_pause = true;
caps->cmd_terminate = true;
- caps->residue_granularity = DMA_RESIDUE_GRANULARITY_DESCRIPTOR;
+ caps->residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;

return 0;
}
--
2.0.0

2014-07-28 06:13:36

by Peter Ujfalusi

[permalink] [raw]
Subject: Re: [PATCH 0/2] dma: edma: Allow to disable eDMA IRQ during cyclic transfer

On 07/16/2014 03:29 PM, Peter Ujfalusi wrote:
> Hi,
>
> After this series clients can ask to not receive notifications after each period.
> In this case we can disable the completion interrupt since the position reporting
> does not rely on it for cyclic mode.
> Patchset for ASoC part has been sent which allows users space to take adventage
> of SNDRV_PCM_INFO_NO_PERIOD_WAKEUP:
> [1] http://mailman.alsa-project.org/pipermail/alsa-devel/2014-July/078993.html

ping.

> When both series applied on top of linux-next:
>
> # cache the audio file in memory
> cat some_music.mp3 > /dev/null
> # start PA
> pulseaudio -v
> # in another terminal, play the music via PA
> mplayer -ao pulse some_music.mp3
> # yet another terminal to monitor the interrupts
> watch cat /proc/interrupts
> # note the non increasing number of edma interrupts ;)
>
> Regards,
> Peter
> ---
> Peter Ujfalusi (2):
> dma: edma: Update caps->residue_granularity to match with reality
> dma: edma: Support to suppress the period interrupts in cyclic mode
>
> drivers/dma/edma.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>


--
P?ter

2014-07-28 11:41:53

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH 0/2] dma: edma: Allow to disable eDMA IRQ during cyclic transfer

On Wed, Jul 16, 2014 at 03:29:19PM +0300, Peter Ujfalusi wrote:
> Hi,
>
> After this series clients can ask to not receive notifications after each period.
> In this case we can disable the completion interrupt since the position reporting
> does not rely on it for cyclic mode.
> Patchset for ASoC part has been sent which allows users space to take adventage
> of SNDRV_PCM_INFO_NO_PERIOD_WAKEUP:
> [1] http://mailman.alsa-project.org/pipermail/alsa-devel/2014-July/078993.html

Applied, thanks

Please use right subsystem name for patches, i have fixed that while
applying

--
~Vinod