Skip to contentSkip to conversation

ALSA: hda - hdmi add wmb barrier for audio component

PATCH Applied [email protected] 2 participants 2 messages Mar 4, 2016 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ALSA: hda - hdmi add wmb barrier for audio component

From: Libin Yang <[email protected]>

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.

---
 sound/pci/hda/patch_hdmi.c | 5 +++++
 1 file changed, 5 insertions(+)
sound/pci/hda/patch_hdmi.c +5 -0
index aa2d6a2..b5190e0 100644
@@ -2939,6 +2939,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);
 	}
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Applied
#1 lore raw
Quoted 8 lines · On Fri, 04 Mar 2016 07:33:06 +0100, [email protected] wrote:

From: Libin Yang <[email protected]>

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.

Thanks, applied both patches to for-linus branch, as it's a 4.4 regression. The merge conflict was resolved in for-next branch.

Takashi

Quoted 23 lines
---
 sound/pci/hda/patch_hdmi.c | 5 +++++
 1 file changed, 5 insertions(+)
sound/pci/hda/patch_hdmi.c +5 -0
index aa2d6a2..b5190e0 100644
@@ -2939,6 +2939,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);
 	}
Signature · 1 line
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx