From patchwork Tue Jun 9 08:30:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 6570241 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1657A9F2F4 for ; Tue, 9 Jun 2015 08:30:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2CE1820495 for ; Tue, 9 Jun 2015 08:30:38 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 0A9C7203A5 for ; Tue, 9 Jun 2015 08:30:36 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 558A42650E4; Tue, 9 Jun 2015 10:30:34 +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,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id AFAB2264FEB; Tue, 9 Jun 2015 10:30:25 +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 4FDEB265068; Tue, 9 Jun 2015 10:30:23 +0200 (CEST) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 41981264FEB for ; Tue, 9 Jun 2015 10:30:16 +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 E8770AD27; Tue, 9 Jun 2015 08:30:15 +0000 (UTC) Date: Tue, 09 Jun 2015 10:30:15 +0200 Message-ID: From: Takashi Iwai To: David Henningsson In-Reply-To: <55768BCB.3060001@canonical.com> References: <1433829918-5807-1-git-send-email-libin.yang@intel.com> <55768BCB.3060001@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: libin.yang@intel.com, alsa-devel@alsa-project.org Subject: Re: [alsa-devel] [PATCH] ALSA: hda - PCH HDA controller not controlled by i915 power 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 At Tue, 09 Jun 2015 08:46:35 +0200, David Henningsson wrote: > > > > On 2015-06-09 08:31, Takashi Iwai wrote: > > At Tue, 9 Jun 2015 14:05:18 +0800, > > libin.yang@intel.com wrote: > >> > >> From: Libin Yang > >> > >> On some Intel platforms, the HDMI codec is connected to PCH HDA > >> controller. In this case, AZX_DCAPS_I915_POWERWELL is set and > >> the i915 power well failure should not block the hda controller > >> initialization. > >> > >> Signed-off-by: Libin Yang > > > > Is this fix needed for 4.1, or it's only for 4.2? > > It's a bug fix, and as such should go to all kernels, even with cc to > stable. That said, it mainly concerns Skylake, so kernels that don't > support Skylake would not need a backport. The patch can't be applied even to 4.1 as is because of the code structure change. So, Cc to stable doesn't work, in anyway. > > I vaguely remember of a bug report. If there is any relevant bug > > report, please give the link, too. > > I think this was raised to Intel by us. The use case is when the > integrated GPU is disabled and a discrete GPU is used. In this case the > i915 module fails to load. If then the HDMI and analog codec are both on > the same controller, the entire controller fails instead of just the > HDMI codec. > > I'll see if I can get the patch tested ASAP. OK, the bug seems needed for 4.1 and earlier. But Libin's patch is only for 4.2. And even worse, backporting this isn't straightforward due to the lack of need_i915_power field. Hmm. I think we can make it easier by just allowing to continue the probe. A totally untested patch for 4.1 is below. thanks, Takashi diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index fea198c58196..3903a62ce1e8 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -340,6 +340,11 @@ enum { #define use_vga_switcheroo(chip) 0 #endif +#define CONTROLLER_IN_GPU(pci) (((pci)->device == 0x0a0c) || \ + ((pci)->device == 0x0c0c) || \ + ((pci)->device == 0x0d0c) || \ + ((pci)->device == 0x160c)) + static char *driver_short_names[] = { [AZX_DRIVER_ICH] = "HDA Intel", [AZX_DRIVER_PCH] = "HDA Intel PCH", @@ -1854,8 +1859,12 @@ static int azx_probe_continue(struct azx *chip) if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) { #ifdef CONFIG_SND_HDA_I915 err = hda_i915_init(hda); - if (err < 0) - goto out_free; + if (err < 0) { + if (CONTROLLER_IN_GPU(pci)) + goto out_free; + else + goto skip_i915; + } err = hda_display_power(hda, true); if (err < 0) { dev_err(chip->card->dev, @@ -1865,6 +1874,7 @@ static int azx_probe_continue(struct azx *chip) #endif } + skip_i915: err = azx_first_init(chip); if (err < 0) goto out_free;