All of lore.kernel.org
 help / color / mirror / Atom feed
* Subject: [PATCH] ASoC: soc-pcm: fix BE dai not hw_free and shutdown during mixer update
@ 2020-05-29  4:10 zhucancan
  2020-05-29  9:44   ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: zhucancan @ 2020-05-29  4:10 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, alsa-devel, linux-kernel
  Cc: kernel, 朱灿灿, trivial

FE state is SND_SOC_DPCM_STATE_PREPARE now, BE1 is
used by FE.

Later when new BE2 is added to FE by mixer update,
it will call dpcm_run_update_startup() to update
BE2's state, but unfortunately BE2 .prepare() meets
error, it will disconnect all non started BE.

This make BE1 dai skip .hw_free() and .shutdown(),
and the BE1 users will never decrease to zero.

Signed-off-by: zhucancan <zhucancan@vivo.com>
---
 sound/soc/soc-pcm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 1f302de44052..df34422bd0dd 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2730,12 +2730,12 @@ static int dpcm_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream)
 close:
  dpcm_be_dai_shutdown(fe, stream);
 disconnect:
- /* disconnect any non started BEs */
+ /* disconnect any closed BEs */
  spin_lock_irqsave(&fe->card->dpcm_lock, flags);
  for_each_dpcm_be(fe, stream, dpcm) {
   struct snd_soc_pcm_runtime *be = dpcm->be;
-  if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START)
-    dpcm->state = SND_SOC_DPCM_LINK_STATE_FREE;
+  if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_CLOSE)
+   dpcm->state = SND_SOC_DPCM_LINK_STATE_FREE;
  }
  spin_unlock_irqrestore(&fe->card->dpcm_lock, flags);
 
-- 
2.21.0



2020-05-29

zhucancan 


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

* Re: Subject: [PATCH] ASoC: soc-pcm: fix BE dai not hw_free and shutdown during mixer update
  2020-05-29  4:10 Subject: [PATCH] ASoC: soc-pcm: fix BE dai not hw_free and shutdown during mixer update zhucancan
@ 2020-05-29  9:44   ` Mark Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2020-05-29  9:44 UTC (permalink / raw)
  To: zhucancan
  Cc: lgirdwood, perex, tiwai, alsa-devel, linux-kernel, kernel, trivial

[-- Attachment #1: Type: text/plain, Size: 416 bytes --]

On Fri, May 29, 2020 at 12:10:26PM +0800, zhucancan wrote:

> +++ b/sound/soc/soc-pcm.c
> @@ -2730,12 +2730,12 @@ static int dpcm_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream)
>  close:
>   dpcm_be_dai_shutdown(fe, stream);
>  disconnect:
> - /* disconnect any non started BEs */
> + /* disconnect any closed BEs */

Your mailer has corrupted the patch (it looks like it replaced tabs with
spaces).

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: Subject: [PATCH] ASoC: soc-pcm: fix BE dai not hw_free and shutdown during mixer update
@ 2020-05-29  9:44   ` Mark Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2020-05-29  9:44 UTC (permalink / raw)
  To: zhucancan; +Cc: alsa-devel, trivial, lgirdwood, linux-kernel, tiwai, kernel

[-- Attachment #1: Type: text/plain, Size: 416 bytes --]

On Fri, May 29, 2020 at 12:10:26PM +0800, zhucancan wrote:

> +++ b/sound/soc/soc-pcm.c
> @@ -2730,12 +2730,12 @@ static int dpcm_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream)
>  close:
>   dpcm_be_dai_shutdown(fe, stream);
>  disconnect:
> - /* disconnect any non started BEs */
> + /* disconnect any closed BEs */

Your mailer has corrupted the patch (it looks like it replaced tabs with
spaces).

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2020-05-29  9:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29  4:10 Subject: [PATCH] ASoC: soc-pcm: fix BE dai not hw_free and shutdown during mixer update zhucancan
2020-05-29  9:44 ` Mark Brown
2020-05-29  9:44   ` Mark Brown

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.