ASoC: bypass powering widget process for platform widgets
Existing logic which calls dapm_power_widgets() regardless type
of widget results in kernel panic because caller of mixer/mux
update power functions must acquire codec mutex. Otherwise,
multiple DAPM powering processes can be executed in parallel
and corrupt commonly shared data structures.
When user-space issues platform mixer/mux command, DAPM
power widgets function should not be called in the mux and
mixer update power functions. soc-dsp framework would take
care of connecting front-end and back-end and kick start
DAPM powering process eventually. Since soc-dsp has access to
CODEC mutex, corruption is avoided.
CRs-fixed: 306115
Signed-off-by: Patrick Lai <plai@codeaurora.org>
Conflicts:
sound/soc/soc-dapm.c
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 57aefe5..b462639 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1821,9 +1821,11 @@
}
if (found) {
- dapm_power_widgets(widget->dapm, SND_SOC_DAPM_STREAM_NOP);
if (widget->platform)
soc_dsp_runtime_update(widget);
+ else
+ dapm_power_widgets(widget->dapm,
+ SND_SOC_DAPM_STREAM_NOP);
}
return 0;
@@ -1854,9 +1856,11 @@
}
if (found) {
- dapm_power_widgets(widget->dapm, SND_SOC_DAPM_STREAM_NOP);
if (widget->platform)
soc_dsp_runtime_update(widget);
+ else
+ dapm_power_widgets(widget->dapm,
+ SND_SOC_DAPM_STREAM_NOP);
}
return 0;