* [PATCH 2/2] ASoC: omap: Stop DMA re enabling in self linkage mode
@ 2010-12-06 22:34 Olaya, Margarita
2010-12-06 22:47 ` Mark Brown
2010-12-07 9:17 ` Peter Ujfalusi
0 siblings, 2 replies; 8+ messages in thread
From: Olaya, Margarita @ 2010-12-06 22:34 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood; +Cc: alsa-devel@alsa-project.org
From: Hari Nagalla <hnagalla@ti.com>
While using self linking, there is a chance that the DMA
has re-enabled the channel just after disabling it.
This patch stops the OMAP4 DMA re-enabling after stoping the
DMA channel.
Signed-off-by: Hari Nagalla <hnagalla@ti.com>
Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
---
sound/soc/omap/omap-pcm.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index 6a21447..afe91ad 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -234,6 +234,13 @@ static int omap_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
prtd->period_index = -1;
omap_stop_dma(prtd->dma_ch);
+ /*
+ * Since we are using self linking, there is a
+ * chance that the DMA as re-enabled the channel
+ * just after disabling it.
+ */
+ while (omap_get_dma_active_status(prtd->dma_ch))
+ omap_stop_dma(prtd->dma_ch);
break;
default:
ret = -EINVAL;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] ASoC: omap: Stop DMA re enabling in self linkage mode
2010-12-06 22:34 [PATCH 2/2] ASoC: omap: Stop DMA re enabling in self linkage mode Olaya, Margarita
@ 2010-12-06 22:47 ` Mark Brown
2010-12-07 9:17 ` Peter Ujfalusi
1 sibling, 0 replies; 8+ messages in thread
From: Mark Brown @ 2010-12-06 22:47 UTC (permalink / raw)
To: Olaya, Margarita; +Cc: alsa-devel@alsa-project.org, Liam Girdwood
On Mon, Dec 06, 2010 at 04:34:47PM -0600, Olaya, Margarita wrote:
> From: Hari Nagalla <hnagalla@ti.com>
>
> While using self linking, there is a chance that the DMA
> has re-enabled the channel just after disabling it.
>
> This patch stops the OMAP4 DMA re-enabling after stoping the
> DMA channel.
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] ASoC: omap: Stop DMA re enabling in self linkage mode
2010-12-06 22:34 [PATCH 2/2] ASoC: omap: Stop DMA re enabling in self linkage mode Olaya, Margarita
2010-12-06 22:47 ` Mark Brown
@ 2010-12-07 9:17 ` Peter Ujfalusi
2010-12-07 14:05 ` Mark Brown
1 sibling, 1 reply; 8+ messages in thread
From: Peter Ujfalusi @ 2010-12-07 9:17 UTC (permalink / raw)
To: alsa-devel; +Cc: ext Olaya, Margarita, Mark Brown, Liam Girdwood
On Tuesday 07 December 2010 00:34:47 ext Olaya, Margarita wrote:
> From: Hari Nagalla <hnagalla@ti.com>
>
> While using self linking, there is a chance that the DMA
> has re-enabled the channel just after disabling it.
>
> This patch stops the OMAP4 DMA re-enabling after stoping the
> DMA channel.
I have not seen this happening on OMAP2/3, or at least I'm not aware of it.
Is this problem OMAP4 only?
Do you know if this happens on playback, capture or in both direction?
Is it worth to do this workaround only on OMAP4?
>
> Signed-off-by: Hari Nagalla <hnagalla@ti.com>
> Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
> ---
> sound/soc/omap/omap-pcm.c | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
> index 6a21447..afe91ad 100644
> --- a/sound/soc/omap/omap-pcm.c
> +++ b/sound/soc/omap/omap-pcm.c
> @@ -234,6 +234,13 @@ static int omap_pcm_trigger(struct snd_pcm_substream
> *substream, int cmd) case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
> prtd->period_index = -1;
> omap_stop_dma(prtd->dma_ch);
> + /*
> + * Since we are using self linking, there is a
> + * chance that the DMA as re-enabled the channel
> + * just after disabling it.
> + */
> + while (omap_get_dma_active_status(prtd->dma_ch))
> + omap_stop_dma(prtd->dma_ch);
> break;
> default:
> ret = -EINVAL;
--
Péter
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] ASoC: omap: Stop DMA re enabling in self linkage mode
2010-12-07 9:17 ` Peter Ujfalusi
@ 2010-12-07 14:05 ` Mark Brown
2010-12-07 14:38 ` Peter Ujfalusi
0 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2010-12-07 14:05 UTC (permalink / raw)
To: Peter Ujfalusi; +Cc: ext Olaya, Margarita, alsa-devel, Liam Girdwood
On Tue, Dec 07, 2010 at 11:17:26AM +0200, Peter Ujfalusi wrote:
> I have not seen this happening on OMAP2/3, or at least I'm not aware of it.
> Is this problem OMAP4 only?
> Do you know if this happens on playback, capture or in both direction?
> Is it worth to do this workaround only on OMAP4?
Given that the patch should cause at most a single read from a register
when tearing down DMA if it's not required I'd guess it's safer to just
unconditionally enable the workaround on the off chance that it's just
reallly rare rather than not needed?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] ASoC: omap: Stop DMA re enabling in self linkage mode
2010-12-07 14:05 ` Mark Brown
@ 2010-12-07 14:38 ` Peter Ujfalusi
2010-12-07 14:43 ` Mark Brown
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2010-12-07 14:38 UTC (permalink / raw)
To: alsa-devel; +Cc: ext Olaya, Margarita, ext Mark Brown, Liam Girdwood
On Tuesday 07 December 2010 16:05:12 ext Mark Brown wrote:
> On Tue, Dec 07, 2010 at 11:17:26AM +0200, Peter Ujfalusi wrote:
> > I have not seen this happening on OMAP2/3, or at least I'm not aware of
> > it. Is this problem OMAP4 only?
> > Do you know if this happens on playback, capture or in both direction?
> > Is it worth to do this workaround only on OMAP4?
>
> Given that the patch should cause at most a single read from a register
> when tearing down DMA if it's not required I'd guess it's safer to just
> unconditionally enable the workaround on the off chance that it's just
> reallly rare rather than not needed?
Sure, it is a single read to a register, but generally I'm a bit nervous, when
we have a while loop without timeout counter.
In theory we could have infinite loop, if the HW has a bad day...
This could be safe on all OMAP platforms, but I think it has been only tested on
OMAP4.
If this could happen, than IMHO it has to be handled by the omap_stop_dma, since
other drivers could be hit by the same problem (there might be ERRATA for it
already for OMAP4).
--
Péter
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] ASoC: omap: Stop DMA re enabling in self linkage mode
2010-12-07 14:38 ` Peter Ujfalusi
@ 2010-12-07 14:43 ` Mark Brown
2010-12-07 15:17 ` Liam Girdwood
2010-12-07 16:00 ` Jarkko Nikula
2 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2010-12-07 14:43 UTC (permalink / raw)
To: Peter Ujfalusi; +Cc: ext Olaya, Margarita, alsa-devel, Liam Girdwood
On Tue, Dec 07, 2010 at 04:38:35PM +0200, Peter Ujfalusi wrote:
> Sure, it is a single read to a register, but generally I'm a bit nervous, when
> we have a while loop without timeout counter.
> In theory we could have infinite loop, if the HW has a bad day...
> This could be safe on all OMAP platforms, but I think it has been only tested on
> OMAP4.
> If this could happen, than IMHO it has to be handled by the omap_stop_dma, since
> other drivers could be hit by the same problem (there might be ERRATA for it
> already for OMAP4).
A timeout would be better in general, yes.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] ASoC: omap: Stop DMA re enabling in self linkage mode
2010-12-07 14:38 ` Peter Ujfalusi
2010-12-07 14:43 ` Mark Brown
@ 2010-12-07 15:17 ` Liam Girdwood
2010-12-07 16:00 ` Jarkko Nikula
2 siblings, 0 replies; 8+ messages in thread
From: Liam Girdwood @ 2010-12-07 15:17 UTC (permalink / raw)
To: Peter Ujfalusi; +Cc: ext Olaya, Margarita, alsa-devel, ext Mark Brown
On Tue, 2010-12-07 at 16:38 +0200, Peter Ujfalusi wrote:
> On Tuesday 07 December 2010 16:05:12 ext Mark Brown wrote:
> > On Tue, Dec 07, 2010 at 11:17:26AM +0200, Peter Ujfalusi wrote:
> > > I have not seen this happening on OMAP2/3, or at least I'm not aware of
> > > it. Is this problem OMAP4 only?
> > > Do you know if this happens on playback, capture or in both direction?
> > > Is it worth to do this workaround only on OMAP4?
> >
> > Given that the patch should cause at most a single read from a register
> > when tearing down DMA if it's not required I'd guess it's safer to just
> > unconditionally enable the workaround on the off chance that it's just
> > reallly rare rather than not needed?
>
> Sure, it is a single read to a register, but generally I'm a bit nervous, when
> we have a while loop without timeout counter.
> In theory we could have infinite loop, if the HW has a bad day...
> This could be safe on all OMAP platforms, but I think it has been only tested on
> OMAP4.
> If this could happen, than IMHO it has to be handled by the omap_stop_dma, since
> other drivers could be hit by the same problem (there might be ERRATA for it
> already for OMAP4).
>
Afaik, this has also been tested on OMAP3. Not sure about OMAP2 and most
likely not tested on OMAP1.
Liam
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] ASoC: omap: Stop DMA re enabling in self linkage mode
2010-12-07 14:38 ` Peter Ujfalusi
2010-12-07 14:43 ` Mark Brown
2010-12-07 15:17 ` Liam Girdwood
@ 2010-12-07 16:00 ` Jarkko Nikula
2 siblings, 0 replies; 8+ messages in thread
From: Jarkko Nikula @ 2010-12-07 16:00 UTC (permalink / raw)
To: Peter Ujfalusi
Cc: ext Olaya, Margarita, alsa-devel, ext Mark Brown, Liam Girdwood
On Tue, 7 Dec 2010 16:38:35 +0200
Peter Ujfalusi <peter.ujfalusi@nokia.com> wrote:
> If this could happen, than IMHO it has to be handled by the omap_stop_dma, since
> other drivers could be hit by the same problem (there might be ERRATA for it
> already for OMAP4).
>
I agree with Peter that all DMA stopping related workarounds should be
in omap_stop_dma. I'd expect that DMA is stopped when returning
from there. Commit 9da65a9 was dealing with similar issue so probably
this looping should be implemented somewhere around those lines reading
& clearing the _CCR_EN bit?
--
Jarkko
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-12-07 16:00 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-06 22:34 [PATCH 2/2] ASoC: omap: Stop DMA re enabling in self linkage mode Olaya, Margarita
2010-12-06 22:47 ` Mark Brown
2010-12-07 9:17 ` Peter Ujfalusi
2010-12-07 14:05 ` Mark Brown
2010-12-07 14:38 ` Peter Ujfalusi
2010-12-07 14:43 ` Mark Brown
2010-12-07 15:17 ` Liam Girdwood
2010-12-07 16:00 ` Jarkko Nikula
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.