From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Subject: [alsa-devel] [PATCH AUTOSEL 5.4 138/350] ASoC: soc-pcm: fixup dpcm_prune_paths() loop continue
Date: Tue, 10 Dec 2019 16:04:03 -0500 [thread overview]
Message-ID: <20191210210735.9077-99-sashal@kernel.org> (raw)
In-Reply-To: <20191210210735.9077-1-sashal@kernel.org>
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
[ Upstream commit bed646dc3f7bcec91178c278deaf969cce0700a8 ]
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>
Link: https://lore.kernel.org/r/87blui64mf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
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 b600d3eaaf5cd..cdce96a3051bf 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1385,6 +1385,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) {
@@ -1398,13 +1399,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.20.1
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2019-12-10 21:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20191210210735.9077-1-sashal@kernel.org>
2019-12-10 21:03 ` [alsa-devel] [PATCH AUTOSEL 5.4 088/350] ASoC: SOF: enable sync_write in hdac_bus Sasha Levin
2019-12-10 21:04 ` Sasha Levin [this message]
2019-12-10 21:04 ` [alsa-devel] [PATCH AUTOSEL 5.4 170/350] ALSA: hda - Fix pending unsol events at shutdown Sasha Levin
2019-12-10 21:04 ` [alsa-devel] [PATCH AUTOSEL 5.4 179/350] ALSA: hda/hdmi - implement mst_no_extra_pcms flag Sasha Levin
2019-12-10 21:04 ` [alsa-devel] [PATCH AUTOSEL 5.4 191/350] ALSA: bebob: expand sleep just after breaking connections for protocol version 1 Sasha Levin
2019-12-10 21:05 ` [alsa-devel] [PATCH AUTOSEL 5.4 195/350] ALSA: pcm: Fix missing check of the new non-cached buffer type Sasha Levin
2019-12-10 21:05 ` [alsa-devel] [PATCH AUTOSEL 5.4 197/350] ASoC: SOF: imx: fix reverse CONFIG_SND_SOC_SOF_OF dependency Sasha Levin
2019-12-11 11:00 ` Mark Brown
2019-12-19 19:46 ` Sasha Levin
2019-12-10 21:05 ` [alsa-devel] [PATCH AUTOSEL 5.4 208/350] ASoC: SOF: topology: set trigger order for FE DAI link Sasha Levin
2019-12-10 21:05 ` [alsa-devel] [PATCH AUTOSEL 5.4 214/350] ALSA: timer: Limit max amount of slave instances Sasha Levin
2019-12-10 21:05 ` [alsa-devel] [PATCH AUTOSEL 5.4 253/350] soundwire: intel: fix PDI/stream mapping for Bulk Sasha Levin
2019-12-10 21:06 ` [alsa-devel] [PATCH AUTOSEL 5.4 265/350] ASoC: rt5677: Mark reg RT5677_PWR_ANLG2 as volatile Sasha Levin
2019-12-10 21:06 ` [alsa-devel] [PATCH AUTOSEL 5.4 269/350] ASoC: Intel: kbl_rt5663_rt5514_max98927: Add dmic format constraint Sasha Levin
2019-12-10 21:06 ` [alsa-devel] [PATCH AUTOSEL 5.4 292/350] ASoC: wm8904: fix regcache handling Sasha Levin
2019-12-10 21:06 ` [alsa-devel] [PATCH AUTOSEL 5.4 302/350] ASoC: wm2200: add missed operations in remove and probe failure Sasha Levin
2019-12-10 21:06 ` [alsa-devel] [PATCH AUTOSEL 5.4 304/350] ASoC: wm5100: add missed pm_runtime_disable Sasha Levin
2019-12-10 21:06 ` [alsa-devel] [PATCH AUTOSEL 5.4 311/350] ASoC: Intel: bytcr_rt5640: Update quirk for Acer Switch 10 SW5-012 2-in-1 Sasha Levin
2019-12-10 21:07 ` [alsa-devel] [PATCH AUTOSEL 5.4 322/350] ASoC: soc-pcm: check symmetry before hw_params Sasha Levin
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=20191210210735.9077-99-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox