summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorLibin Yang <libin.yang@linux.intel.com>2016-03-04 14:33:06 +0800
committerTakashi Iwai <tiwai@suse.de>2016-03-04 08:37:59 +0100
commitec75a940b1037e877efd9a5a9e94eab1e464f73b (patch)
tree10e876cc4992497a328580ab7446579e1ee01c21 /sound
parent02322ac9dee9aff8d8862e8d6660ebe102f492ea (diff)
downloadlinux-ec75a940b1037e877efd9a5a9e94eab1e464f73b.tar.gz
linux-ec75a940b1037e877efd9a5a9e94eab1e464f73b.tar.bz2
linux-ec75a940b1037e877efd9a5a9e94eab1e464f73b.zip
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: Libin Yang <libin.yang@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_hdmi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 8ee78dbd4c60..6858e88c7326 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -2480,6 +2480,11 @@ static int patch_generic_hdmi(struct hda_codec *codec)
if (codec_has_acomp(codec)) {
codec->depop_delay = 0;
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;
snd_hdac_i915_register_notifier(&spec->i915_audio_ops);
}