All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Subject: [alsa-devel] [PATCH v2 01/22] ASoC: soc-pcm: fixup dpcm_prune_paths() loop continue
Date: 15 Oct 2019 12:59:38 +0900	[thread overview]
Message-ID: <87blui64mf.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87d0ey64n5.wl-kuninori.morimoto.gx@renesas.com>

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

dpcm_prune_paths() is checking widget at 2 parts.
(A) is for CPU, (B) is for Codec.
If we focus to (A) part, continue at (a) is for (1) loop. But,
if we focus to (B) part, continue at (b) is for (2) loop, not for (1).
This is bug.
This patch fixup this issue.

	static int dpcm_prune_paths(...)
	{
		...
   (1)		for_each_dpcm_be(fe, stream, dpcm) {
			...

 ^			widget = dai_get_widget(...);
 |
(A)			if (widget && widget_in_list(...))
 | (a)				continue;
 v
 ^ (2)			for_each_rtd_codec_dai(...) {
 |				widget = dai_get_widget(...);
(B)
 |				if (widget && widget_in_list(...))
 v (b)					continue;
			}
			...

Fixes: 2e5894d73789 ("ASoC: pcm: Add support for DAI multicodec")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

	- merged not yet accepted patch

 sound/soc/soc-pcm.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 6706b91..5d973ac 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1443,6 +1443,7 @@ static int dpcm_prune_paths(struct snd_soc_pcm_runtime *fe, int stream,
 	struct snd_soc_dapm_widget *widget;
 	struct snd_soc_dai *dai;
 	int prune = 0;
+	int do_prune;
 
 	/* Destroy any old FE <--> BE connections */
 	for_each_dpcm_be(fe, stream, dpcm) {
@@ -1456,13 +1457,16 @@ static int dpcm_prune_paths(struct snd_soc_pcm_runtime *fe, int stream,
 			continue;
 
 		/* is there a valid CODEC DAI widget for this BE */
+		do_prune = 1;
 		for_each_rtd_codec_dai(dpcm->be, i, dai) {
 			widget = dai_get_widget(dai, stream);
 
 			/* prune the BE if it's no longer in our active list */
 			if (widget && widget_in_list(list, widget))
-				continue;
+				do_prune = 0;
 		}
+		if (!do_prune)
+			continue;
 
 		dev_dbg(fe->dev, "ASoC: pruning %s BE %s for %s\n",
 			stream ? "capture" : "playback",
-- 
2.7.4

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  parent reply	other threads:[~2019-10-15  4:02 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15  3:59 [alsa-devel] [PATCH v2 00/22] ASoC: soc-core cleanup - step 4 Kuninori Morimoto
2019-10-15  3:59 ` [alsa-devel] [PATCH v2 03/22] ASoC: soc-core: add for_each_rtd_components() and replace Kuninori Morimoto
2019-10-23 18:56   ` [alsa-devel] Applied "ASoC: soc-core: add for_each_rtd_components() and replace" to the asoc tree Mark Brown
2019-10-15  3:59 ` Kuninori Morimoto [this message]
2019-10-22 18:15   ` [alsa-devel] Applied "ASoC: soc-pcm: fixup dpcm_prune_paths() loop continue" " Mark Brown
2019-10-15  3:59 ` [alsa-devel] [PATCH v2 02/22] ASoC: soc-core: remove for_each_rtdcom_safe() Kuninori Morimoto
2019-10-22 18:15   ` [alsa-devel] Applied "ASoC: soc-core: remove for_each_rtdcom_safe()" to the asoc tree Mark Brown
2019-10-15  3:59 ` [alsa-devel] [PATCH v2 07/22] ASoC: soc-core: tidyup soc_init_dai_link() Kuninori Morimoto
2019-10-24 11:48   ` Mark Brown
2019-10-25  0:55     ` Kuninori Morimoto
2019-10-15  3:59 ` [alsa-devel] [PATCH v2 04/22] ASoC: soc-core: snd_soc_unbind_card() cleanup Kuninori Morimoto
2019-10-22 18:15   ` [alsa-devel] Applied "ASoC: soc-core: snd_soc_unbind_card() cleanup" to the asoc tree Mark Brown
2019-10-15  3:59 ` [alsa-devel] [PATCH v2 05/22] ASoC: soc-core: remove unneeded snd_soc_tplg_component_remove() Kuninori Morimoto
2019-10-15  4:00 ` [alsa-devel] [PATCH v2 09/22] ASoC: soc-core: call soc_bind_dai_link() under snd_soc_add_dai_link() Kuninori Morimoto
2019-10-15  4:00 ` [alsa-devel] [PATCH v2 06/22] ASoC: soc-core: move soc_init_dai_link() Kuninori Morimoto
2019-10-15  4:00 ` [alsa-devel] [PATCH v2 10/22] ASoC: soc-core: add soc_unbind_dai_link() Kuninori Morimoto
2019-10-15  4:00 ` [alsa-devel] [PATCH v2 08/22] ASoC: soc-core: remove duplicated soc_is_dai_link_bound() Kuninori Morimoto
2019-10-15  4:00 ` [alsa-devel] [PATCH v2 11/22] ASoC: soc-core: move snd_soc_lookup_component() Kuninori Morimoto
2019-10-15  4:00 ` [alsa-devel] [PATCH v2 12/22] ASoC: soc-core: add snd_soc_del_component_unlocked() Kuninori Morimoto
2019-10-15  4:00 ` [alsa-devel] [PATCH v2 14/22] ASoC: soc-core: use snd_soc_lookup_component() at snd_soc_unregister_component() Kuninori Morimoto
2019-10-15  4:00 ` [alsa-devel] [PATCH v2 15/22] ASoC: soc-core: move snd_soc_register_dai() Kuninori Morimoto
2019-10-15  4:00 ` [alsa-devel] [PATCH v2 18/22] ASoC: soc-core: have legacy_dai_naming at snd_soc_register_dai() Kuninori Morimoto
2019-10-15  4:00 ` [alsa-devel] [PATCH v2 19/22] ASoC: soc-core: don't call snd_soc_dapm_new_dai_widgets() " Kuninori Morimoto
2019-10-15  4:00 ` [alsa-devel] [PATCH v2 20/22] ASoC: soc-core: call snd_soc_register_dai() from snd_soc_register_dais() Kuninori Morimoto
2019-10-15  4:00 ` [alsa-devel] [PATCH v2 16/22] ASoC: soc-core: move snd_soc_unregister_dais() Kuninori Morimoto
2019-10-15  4:00 ` [alsa-devel] [PATCH v2 21/22] ASoC: soc-core: remove topology specific operation Kuninori Morimoto
2019-10-15  4:00 ` [alsa-devel] [PATCH v2 17/22] ASoC: soc-core: add snd_soc_unregister_dai() Kuninori Morimoto
2019-10-15  4:00 ` [alsa-devel] [PATCH v2 22/22] ASoC: soc.h: dobj is used only when SND_SOC_TOPOLOGY Kuninori Morimoto
2019-10-15  4:01 ` [alsa-devel] [PATCH v2 13/22] ASoC: soc-core: remove snd_soc_component_add/del() Kuninori Morimoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87blui64mf.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.