From patchwork Wed Jul 6 01:48:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hui Wang X-Patchwork-Id: 645053 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3rkkGy6Fhtz9s9x; Wed, 6 Jul 2016 11:50:34 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1bKbyx-0006AW-QF; Wed, 06 Jul 2016 01:50:31 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1bKbyh-00066G-B1 for kernel-team@lists.ubuntu.com; Wed, 06 Jul 2016 01:50:15 +0000 Received: from [114.254.45.210] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1bKbyg-0000Mz-Jb; Wed, 06 Jul 2016 01:50:15 +0000 From: Hui Wang To: kernel-team@lists.ubuntu.com Subject: [Xenial PATCH 2/3] ALSA: hda - hdmi add wmb barrier for audio component Date: Wed, 6 Jul 2016 09:48:06 +0800 Message-Id: <1467769687-4777-3-git-send-email-hui.wang@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467769687-4777-1-git-send-email-hui.wang@canonical.com> References: <1467769687-4777-1-git-send-email-hui.wang@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: Libin Yang BugLink: http://bugs.launchpad.net/bugs/1596871 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 Signed-off-by: Takashi Iwai (cherry picked from commit ec75a940b1037e877efd9a5a9e94eab1e464f73b) Signed-off-by: Hui Wang --- sound/pci/hda/patch_hdmi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 5b6caca..d465ec8 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -2395,6 +2395,11 @@ static int patch_generic_hdmi(struct hda_codec *codec) if (is_haswell_plus(codec) || is_valleyview_plus(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); }