* [PATCH] ASoC: Flush Samsung DMA on free
@ 2011-09-20 22:26 Mark Brown
[not found] ` <005e01cc7853$7a3d5400$6eb7fc00$%kim@samsung.com>
2011-09-27 0:05 ` Kukjin Kim
0 siblings, 2 replies; 3+ messages in thread
From: Mark Brown @ 2011-09-20 22:26 UTC (permalink / raw)
To: Kukjin Kim, Liam Girdwood, Boojin Kim; +Cc: alsa-devel, patches, Mark Brown
Ever since it was written the Samsung DMA driver has had a TODO in the
hw_free() function wondering if we need to flush the DMA buffers. Up until
now the answer has been no but with the recent improvements Boojin has
done to the DMA infrastructure for the Samsung port the answer has changed
to yes for at least S3C6410 systems.
If we don't then when we next prepare() the channel the API will get
confused trying to run callbacks on the transfers hanging around from the
previous time the stream was open and oops.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
Kukjin, this should probably get added to your branch assuming it's OK
for other CPUs.
sound/soc/samsung/dma.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c
index 851346f..2d622b6 100644
--- a/sound/soc/samsung/dma.c
+++ b/sound/soc/samsung/dma.c
@@ -198,10 +198,10 @@ static int dma_hw_free(struct snd_pcm_substream *substream)
pr_debug("Entered %s\n", __func__);
- /* TODO - do we need to ensure DMA flushed */
snd_pcm_set_runtime_buffer(substream, NULL);
if (prtd->params) {
+ prtd->params->ops->flush(prtd->params->ch);
prtd->params->ops->release(prtd->params->ch,
prtd->params->client);
prtd->params = NULL;
--
1.7.6.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: Flush Samsung DMA on free
[not found] ` <005e01cc7853$7a3d5400$6eb7fc00$%kim@samsung.com>
@ 2011-09-21 11:51 ` Kukjin Kim
0 siblings, 0 replies; 3+ messages in thread
From: Kukjin Kim @ 2011-09-21 11:51 UTC (permalink / raw)
To: 'Boojin Kim', 'Mark Brown',
'Liam Girdwood'
Cc: alsa-devel, patches
Boojin Kim wrote:
>
>
> Mark Brown wrote:
> >
> > Ever since it was written the Samsung DMA driver has had a TODO in the
> > hw_free() function wondering if we need to flush the DMA buffers. Up
> > until
> > now the answer has been no but with the recent improvements Boojin has
> > done to the DMA infrastructure for the Samsung port the answer has
> > changed
> > to yes for at least S3C6410 systems.
> >
> > If we don't then when we next prepare() the channel the API will get
> > confused trying to run callbacks on the transfers hanging around from
> > the
> > previous time the stream was open and oops.
> >
> > Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
>
>
> Your patch give good effect to all Samsung SoCs.
> Thanks a lot.
>
> Acked-by: Boojin Kim <boojin.kim@samsung.com>
>
> > ---
> >
> > Kukjin, this should probably get added to your branch assuming it's OK
> > for other CPUs.
> >
Looks ok to me, will apply.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
> > sound/soc/samsung/dma.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c
> > index 851346f..2d622b6 100644
> > --- a/sound/soc/samsung/dma.c
> > +++ b/sound/soc/samsung/dma.c
> > @@ -198,10 +198,10 @@ static int dma_hw_free(struct snd_pcm_substream
> > *substream)
> >
> > pr_debug("Entered %s\n", __func__);
> >
> > - /* TODO - do we need to ensure DMA flushed */
> > snd_pcm_set_runtime_buffer(substream, NULL);
> >
> > if (prtd->params) {
> > + prtd->params->ops->flush(prtd->params->ch);
> > prtd->params->ops->release(prtd->params->ch,
> > prtd->params->client);
> > prtd->params = NULL;
> > --
> > 1.7.6.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: Flush Samsung DMA on free
2011-09-20 22:26 [PATCH] ASoC: Flush Samsung DMA on free Mark Brown
[not found] ` <005e01cc7853$7a3d5400$6eb7fc00$%kim@samsung.com>
@ 2011-09-27 0:05 ` Kukjin Kim
1 sibling, 0 replies; 3+ messages in thread
From: Kukjin Kim @ 2011-09-27 0:05 UTC (permalink / raw)
To: 'Mark Brown', 'Liam Girdwood',
'Boojin Kim'
Cc: alsa-devel, patches
Mark Brown wrote:
>
> Ever since it was written the Samsung DMA driver has had a TODO in the
> hw_free() function wondering if we need to flush the DMA buffers. Up until
> now the answer has been no but with the recent improvements Boojin has
> done to the DMA infrastructure for the Samsung port the answer has changed
> to yes for at least S3C6410 systems.
>
> If we don't then when we next prepare() the channel the API will get
> confused trying to run callbacks on the transfers hanging around from the
> previous time the stream was open and oops.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>
> Kukjin, this should probably get added to your branch assuming it's OK
> for other CPUs.
>
Looks ok to me, applied.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
> sound/soc/samsung/dma.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c
> index 851346f..2d622b6 100644
> --- a/sound/soc/samsung/dma.c
> +++ b/sound/soc/samsung/dma.c
> @@ -198,10 +198,10 @@ static int dma_hw_free(struct snd_pcm_substream
> *substream)
>
> pr_debug("Entered %s\n", __func__);
>
> - /* TODO - do we need to ensure DMA flushed */
> snd_pcm_set_runtime_buffer(substream, NULL);
>
> if (prtd->params) {
> + prtd->params->ops->flush(prtd->params->ch);
> prtd->params->ops->release(prtd->params->ch,
> prtd->params->client);
> prtd->params = NULL;
> --
> 1.7.6.3
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-09-27 0:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-20 22:26 [PATCH] ASoC: Flush Samsung DMA on free Mark Brown
[not found] ` <005e01cc7853$7a3d5400$6eb7fc00$%kim@samsung.com>
2011-09-21 11:51 ` Kukjin Kim
2011-09-27 0:05 ` Kukjin Kim
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).