Skip to content

Commit ec75a94

Browse files
libinyangtiwai
authored andcommitted
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 <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 02322ac commit ec75a94

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sound/pci/hda/patch_hdmi.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2480,6 +2480,11 @@ static int patch_generic_hdmi(struct hda_codec *codec)
24802480
if (codec_has_acomp(codec)) {
24812481
codec->depop_delay = 0;
24822482
spec->i915_audio_ops.audio_ptr = codec;
2483+
/* intel_audio_codec_enable() or intel_audio_codec_disable()
2484+
* will call pin_eld_notify with using audio_ptr pointer
2485+
* We need make sure audio_ptr is really setup
2486+
*/
2487+
wmb();
24832488
spec->i915_audio_ops.pin_eld_notify = intel_pin_eld_notify;
24842489
snd_hdac_i915_register_notifier(&spec->i915_audio_ops);
24852490
}

0 commit comments

Comments
 (0)