From patchwork Wed Jul 15 08:00:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 6794441 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 93182C05AC for ; Wed, 15 Jul 2015 08:00:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C00322052F for ; Wed, 15 Jul 2015 08:00:55 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 232C42052A for ; Wed, 15 Jul 2015 08:00:53 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0182B26568F; Wed, 15 Jul 2015 10:00:50 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id E3DC32605B7; Wed, 15 Jul 2015 10:00:48 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id CD58026060F; Wed, 15 Jul 2015 10:00:47 +0200 (CEST) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id C420B26044B for ; Wed, 15 Jul 2015 10:00:40 +0200 (CEST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3DF44AAF2; Wed, 15 Jul 2015 08:00:39 +0000 (UTC) Date: Wed, 15 Jul 2015 10:00:39 +0200 Message-ID: From: Takashi Iwai To: David Henningsson In-Reply-To: <1436945975-3279-1-git-send-email-david.henningsson@canonical.com> References: <1436945975-3279-1-git-send-email-david.henningsson@canonical.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.5 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: hui.wang@canonical.com, mengdong.lin@intel.com, alsa-devel@alsa-project.org Subject: Re: [alsa-devel] [PATCH] ALSA: hda - Fix Skylake codec timeouts X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, 15 Jul 2015 09:39:35 +0200, David Henningsson wrote: > > When the controller is powered up but the HDMI codec is powered down > on Skylake, the power well is turned off. When the codec is then > powered up again, we need to poke the codec a little extra to make > sure it wakes up. Otherwise we'll get sad "no response from codec" > messages and broken audio. > > Signed-off-by: David Henningsson > Tested-by: Woodrow Shen > --- > > * It would good to have an ack from Intel on this patch, since they > have better hardware knowledge than I. > > * Also I haven't really kept track of all recent reorganisation of the > hda driver so I'm not totally sure how many kernels back (if any) > that this applies to > > sound/pci/hda/hda_intel.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c > index ca151b4..872e9a7 100644 > --- a/sound/pci/hda/hda_intel.c > +++ b/sound/pci/hda/hda_intel.c > @@ -567,9 +567,17 @@ static int azx_position_check(struct azx *chip, struct azx_dev *azx_dev) > /* Enable/disable i915 display power for the link */ > static int azx_intel_link_power(struct azx *chip, bool enable) > { > + int err; > struct hdac_bus *bus = azx_bus(chip); > > - return snd_hdac_display_power(bus, enable); > + err = snd_hdac_display_power(bus, enable); > + if (err < 0) > + return err; > + if (enable && (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)) { > + snd_hdac_set_codec_wakeup(bus, true); > + snd_hdac_set_codec_wakeup(bus, false); > + } Wouldn't it be better to put in snd_hadc_display_power() itself? Takashi --- a/sound/hda/hdac_i915.c +++ b/sound/hda/hdac_i915.c @@ -56,8 +56,11 @@ int snd_hdac_display_power(struct hdac_bus *bus, bool enable) enable ? "enable" : "disable"); if (enable) { - if (!bus->i915_power_refcount++) + if (!bus->i915_power_refcount++) { acomp->ops->get_power(acomp->dev); + snd_hdac_set_codec_wakeup(bus, true); + snd_hdac_set_codec_wakeup(bus, false); + } } else { WARN_ON(!bus->i915_power_refcount); if (!--bus->i915_power_refcount)