Commit ec75a940 authored by Libin Yang's avatar Libin Yang Committed by Takashi Iwai

ALSA: hda - hdmi add wmb barrier for audio component

To make sure audio_ptr is set before intel_audio_codec_enable()
or intel_audio_codec_disable() calling pin_eld_notify(),
this patch adds wmb barrier to prevent optimizing.
Signed-off-by: default avatarLibin Yang <libin.yang@linux.intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 02322ac9
...@@ -2480,6 +2480,11 @@ static int patch_generic_hdmi(struct hda_codec *codec) ...@@ -2480,6 +2480,11 @@ static int patch_generic_hdmi(struct hda_codec *codec)
if (codec_has_acomp(codec)) { if (codec_has_acomp(codec)) {
codec->depop_delay = 0; codec->depop_delay = 0;
spec->i915_audio_ops.audio_ptr = codec; spec->i915_audio_ops.audio_ptr = codec;
/* intel_audio_codec_enable() or intel_audio_codec_disable()
* will call pin_eld_notify with using audio_ptr pointer
* We need make sure audio_ptr is really setup
*/
wmb();
spec->i915_audio_ops.pin_eld_notify = intel_pin_eld_notify; spec->i915_audio_ops.pin_eld_notify = intel_pin_eld_notify;
snd_hdac_i915_register_notifier(&spec->i915_audio_ops); snd_hdac_i915_register_notifier(&spec->i915_audio_ops);
} }
......
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