All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] dmaengine: omap-dma: Fix cyclic suspend/resume
@ 2014-09-16 19:45 ` Peter Ujfalusi
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Ujfalusi @ 2014-09-16 19:45 UTC (permalink / raw)
  To: vinod.koul, dan.j.williams, Russell King - ARM Linux
  Cc: dmaengine, linux-kernel, linux-omap

Hi,

Changes since v2:
- fix typo in patch two
- Acked-by added from Russell

When the audio is paused/resumed (application paused the sream or board suspend)
the audio was only playing back one period worth of data and then stops because
the omap_dam_stop() clears the link configuration and it is not restored in
start.

Also add memory barrier call to resume path since this could happen right after
coming out from suspend.

Regards,
Peter
---
Peter Ujfalusi (2):
  dmaengine: omap-dma: Add memory barrier to dma_resume path
  dmaengine: omap-dma: Restore the CLINK_CTRL in resume path

 drivers/dma/omap-dma.c | 5 +++++
 1 file changed, 5 insertions(+)

-- 
2.1.0


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

* [PATCH v3 0/2] dmaengine: omap-dma: Fix cyclic suspend/resume
@ 2014-09-16 19:45 ` Peter Ujfalusi
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Ujfalusi @ 2014-09-16 19:45 UTC (permalink / raw)
  To: vinod.koul, dan.j.williams, Russell King - ARM Linux
  Cc: dmaengine, linux-kernel, linux-omap

Hi,

Changes since v2:
- fix typo in patch two
- Acked-by added from Russell

When the audio is paused/resumed (application paused the sream or board suspend)
the audio was only playing back one period worth of data and then stops because
the omap_dam_stop() clears the link configuration and it is not restored in
start.

Also add memory barrier call to resume path since this could happen right after
coming out from suspend.

Regards,
Peter
---
Peter Ujfalusi (2):
  dmaengine: omap-dma: Add memory barrier to dma_resume path
  dmaengine: omap-dma: Restore the CLINK_CTRL in resume path

 drivers/dma/omap-dma.c | 5 +++++
 1 file changed, 5 insertions(+)

-- 
2.1.0

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

* [PATCH v3 1/2] dmaengine: omap-dma: Add memory barrier to dma_resume path
  2014-09-16 19:45 ` Peter Ujfalusi
@ 2014-09-16 19:45   ` Peter Ujfalusi
  -1 siblings, 0 replies; 9+ messages in thread
From: Peter Ujfalusi @ 2014-09-16 19:45 UTC (permalink / raw)
  To: vinod.koul, dan.j.williams, Russell King - ARM Linux
  Cc: dmaengine, linux-kernel, linux-omap

Add mb() call to resume path to ensure the necessary barrier.
Resume can happen after waking up from suspend for example.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 drivers/dma/omap-dma.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index 4cf7d9a950d7..c01ea505ee7c 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -1017,6 +1017,8 @@ static int omap_dma_resume(struct omap_chan *c)
 		return -EINVAL;
 
 	if (c->paused) {
+		mb();
+
 		omap_dma_start(c, c->desc);
 		c->paused = false;
 	}
-- 
2.1.0


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

* [PATCH v3 1/2] dmaengine: omap-dma: Add memory barrier to dma_resume path
@ 2014-09-16 19:45   ` Peter Ujfalusi
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Ujfalusi @ 2014-09-16 19:45 UTC (permalink / raw)
  To: vinod.koul, dan.j.williams, Russell King - ARM Linux
  Cc: dmaengine, linux-kernel, linux-omap

Add mb() call to resume path to ensure the necessary barrier.
Resume can happen after waking up from suspend for example.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 drivers/dma/omap-dma.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index 4cf7d9a950d7..c01ea505ee7c 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -1017,6 +1017,8 @@ static int omap_dma_resume(struct omap_chan *c)
 		return -EINVAL;
 
 	if (c->paused) {
+		mb();
+
 		omap_dma_start(c, c->desc);
 		c->paused = false;
 	}
-- 
2.1.0


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

* [PATCH v3 2/2] dmaengine: omap-dma: Restore the CLINK_CTRL in resume path
  2014-09-16 19:45 ` Peter Ujfalusi
@ 2014-09-16 19:45   ` Peter Ujfalusi
  -1 siblings, 0 replies; 9+ messages in thread
From: Peter Ujfalusi @ 2014-09-16 19:45 UTC (permalink / raw)
  To: vinod.koul, dan.j.williams, Russell King - ARM Linux
  Cc: dmaengine, linux-kernel, linux-omap

When the audio stream is paused or suspended we stop the sDMA and when it
is unpaused/resumed we start the channel without reconfiguring it.
The omap_dma_stop() clears the link configuration when we pause the dma, but
it is not setting it back on start. This will result only one audio buffer
to be played back and the DMA will stop, since the linking is disabled.
We need to restore the CLINK_CTRL register in case of resume.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 drivers/dma/omap-dma.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index c01ea505ee7c..bbea8243f9e8 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -1019,6 +1019,9 @@ static int omap_dma_resume(struct omap_chan *c)
 	if (c->paused) {
 		mb();
 
+		/* Restore channel link register */
+		omap_dma_chan_write(c, CLNK_CTRL, c->desc->clnk_ctrl);
+
 		omap_dma_start(c, c->desc);
 		c->paused = false;
 	}
-- 
2.1.0


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

* [PATCH v3 2/2] dmaengine: omap-dma: Restore the CLINK_CTRL in resume path
@ 2014-09-16 19:45   ` Peter Ujfalusi
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Ujfalusi @ 2014-09-16 19:45 UTC (permalink / raw)
  To: vinod.koul, dan.j.williams, Russell King - ARM Linux
  Cc: dmaengine, linux-kernel, linux-omap

When the audio stream is paused or suspended we stop the sDMA and when it
is unpaused/resumed we start the channel without reconfiguring it.
The omap_dma_stop() clears the link configuration when we pause the dma, but
it is not setting it back on start. This will result only one audio buffer
to be played back and the DMA will stop, since the linking is disabled.
We need to restore the CLINK_CTRL register in case of resume.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 drivers/dma/omap-dma.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index c01ea505ee7c..bbea8243f9e8 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -1019,6 +1019,9 @@ static int omap_dma_resume(struct omap_chan *c)
 	if (c->paused) {
 		mb();
 
+		/* Restore channel link register */
+		omap_dma_chan_write(c, CLNK_CTRL, c->desc->clnk_ctrl);
+
 		omap_dma_start(c, c->desc);
 		c->paused = false;
 	}
-- 
2.1.0

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

* Re: [PATCH v3 0/2] dmaengine: omap-dma: Fix cyclic suspend/resume
  2014-09-16 19:45 ` Peter Ujfalusi
@ 2014-09-17 18:38   ` Peter Ujfalusi
  -1 siblings, 0 replies; 9+ messages in thread
From: Peter Ujfalusi @ 2014-09-17 18:38 UTC (permalink / raw)
  To: vinod.koul, dan.j.williams, Russell King - ARM Linux
  Cc: dmaengine, linux-kernel, linux-omap

Vinod,

On 09/16/2014 10:45 PM, Peter Ujfalusi wrote:
> Hi,
> 
> Changes since v2:
> - fix typo in patch two
> - Acked-by added from Russell
> 
> When the audio is paused/resumed (application paused the sream or board suspend)
> the audio was only playing back one period worth of data and then stops because
> the omap_dam_stop() clears the link configuration and it is not restored in
> start.
> 
> Also add memory barrier call to resume path since this could happen right after
> coming out from suspend.

Would it be possible to queue this two patch for 3.17?
This stop/start issue affects not only board suspend/resume, but in all cases
when application pauses the stream as well when we have underrun in ALSA
which would not trigger a full stop and start of audio.

Thanks,
Péter

> Regards,
> Peter
> ---
> Peter Ujfalusi (2):
>   dmaengine: omap-dma: Add memory barrier to dma_resume path
>   dmaengine: omap-dma: Restore the CLINK_CTRL in resume path
> 
>  drivers/dma/omap-dma.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 



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

* Re: [PATCH v3 0/2] dmaengine: omap-dma: Fix cyclic suspend/resume
@ 2014-09-17 18:38   ` Peter Ujfalusi
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Ujfalusi @ 2014-09-17 18:38 UTC (permalink / raw)
  To: vinod.koul, dan.j.williams, Russell King - ARM Linux
  Cc: dmaengine, linux-kernel, linux-omap

Vinod,

On 09/16/2014 10:45 PM, Peter Ujfalusi wrote:
> Hi,
> 
> Changes since v2:
> - fix typo in patch two
> - Acked-by added from Russell
> 
> When the audio is paused/resumed (application paused the sream or board suspend)
> the audio was only playing back one period worth of data and then stops because
> the omap_dam_stop() clears the link configuration and it is not restored in
> start.
> 
> Also add memory barrier call to resume path since this could happen right after
> coming out from suspend.

Would it be possible to queue this two patch for 3.17?
This stop/start issue affects not only board suspend/resume, but in all cases
when application pauses the stream as well when we have underrun in ALSA
which would not trigger a full stop and start of audio.

Thanks,
Péter

> Regards,
> Peter
> ---
> Peter Ujfalusi (2):
>   dmaengine: omap-dma: Add memory barrier to dma_resume path
>   dmaengine: omap-dma: Restore the CLINK_CTRL in resume path
> 
>  drivers/dma/omap-dma.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 

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

* Re: [PATCH v3 0/2] dmaengine: omap-dma: Fix cyclic suspend/resume
  2014-09-16 19:45 ` Peter Ujfalusi
                   ` (3 preceding siblings ...)
  (?)
@ 2014-09-23 12:53 ` Vinod Koul
  -1 siblings, 0 replies; 9+ messages in thread
From: Vinod Koul @ 2014-09-23 12:53 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: dan.j.williams, Russell King - ARM Linux, dmaengine,
	linux-kernel, linux-omap

On Tue, Sep 16, 2014 at 10:45:55PM +0300, Peter Ujfalusi wrote:
> Hi,
> 
> Changes since v2:
> - fix typo in patch two
> - Acked-by added from Russell
> 
> When the audio is paused/resumed (application paused the sream or board suspend)
> the audio was only playing back one period worth of data and then stops because
> the omap_dam_stop() clears the link configuration and it is not restored in
> start.
> 
> Also add memory barrier call to resume path since this could happen right after
> coming out from suspend.

Applied, thanks

-- 
~Vinod


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

end of thread, other threads:[~2014-09-23 13:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-16 19:45 [PATCH v3 0/2] dmaengine: omap-dma: Fix cyclic suspend/resume Peter Ujfalusi
2014-09-16 19:45 ` Peter Ujfalusi
2014-09-16 19:45 ` [PATCH v3 1/2] dmaengine: omap-dma: Add memory barrier to dma_resume path Peter Ujfalusi
2014-09-16 19:45   ` Peter Ujfalusi
2014-09-16 19:45 ` [PATCH v3 2/2] dmaengine: omap-dma: Restore the CLINK_CTRL in resume path Peter Ujfalusi
2014-09-16 19:45   ` Peter Ujfalusi
2014-09-17 18:38 ` [PATCH v3 0/2] dmaengine: omap-dma: Fix cyclic suspend/resume Peter Ujfalusi
2014-09-17 18:38   ` Peter Ujfalusi
2014-09-23 12:53 ` Vinod Koul

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.