ASoC: Serialize access to dapm_power_widgets()
authorEero Nurkkala <ext-eero.nurkkala@nokia.com>
Mon, 12 Oct 2009 05:41:59 +0000 (08:41 +0300)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 13 Oct 2009 12:33:02 +0000 (13:33 +0100)
commit8e8b2d676f3f7c1246b108793fb5690e6c6fcd26
tree12953d54da24f6a92a143303258987e51ac8878b
parent6f775ba0154cdf10108071acc71f26c4efdb8d57
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: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/soc-dapm.c