Skip to content

Commit

Permalink
ASoC: Serialize access to dapm_power_widgets()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eero Nurkkala authored and Mark Brown committed Oct 13, 2009
1 parent 6f775ba commit 8e8b2d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2072,9 +2072,9 @@ int snd_soc_dapm_stream_event(struct snd_soc_codec *codec,
}
}
}
mutex_unlock(&codec->mutex);

dapm_power_widgets(codec, event);
mutex_unlock(&codec->mutex);
dump_dapm(codec, __func__);
return 0;
}
Expand Down

0 comments on commit 8e8b2d6

Please sign in to comment.