Commit 8e8b2d67 authored by Eero Nurkkala's avatar Eero Nurkkala Committed by Mark Brown

ASoC: Serialize access to dapm_power_widgets()

Access to damp_power_widgets() is assumed to be single-threaded.
Concurrent accesses to dapm_power_widgets() may result in
unpredictable behavior.

Calls from:
close_delayed_work()
soc_codec_close()
soc_pcm_prepare()
soc_suspend()
soc_resume_deferred()
to snd_soc_dapm_stream_event() do not have the codec->mutex
taken to cover the call to dapm_power_widgets(). Thus, take
the mutex in these paths also to assure single-threaded use
of dapm_power_widgets().
Signed-off-by: default avatarEero Nurkkala <ext-eero.nurkkala@nokia.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 6f775ba0
...@@ -2072,9 +2072,9 @@ int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, ...@@ -2072,9 +2072,9 @@ int snd_soc_dapm_stream_event(struct snd_soc_codec *codec,
} }
} }
} }
mutex_unlock(&codec->mutex);
dapm_power_widgets(codec, event); dapm_power_widgets(codec, event);
mutex_unlock(&codec->mutex);
dump_dapm(codec, __func__); dump_dapm(codec, __func__);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment