Received: by 10.192.165.156 with SMTP id m28csp867853imm; Fri, 13 Apr 2018 09:10:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx48Ddanp6QE79jOniYTAhPKsApbPCid/XfWeZHJAzA7swXmiAyUPoOllkhKkLlgmfkL0oVAA X-Received: by 2002:a17:902:a24:: with SMTP id 33-v6mr5797687plo.72.1523635813356; Fri, 13 Apr 2018 09:10:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523635813; cv=none; d=google.com; s=arc-20160816; b=ULJPgf7n1BOcz9A1TkT2pWyvb6hLGFbVfdUyLfTf/b34Z5z42pQnNSZQCtPjcKLKyM j7hYEY1H5h7BJyFwkJoaSsTcxlkq7PWFuGw8zsjXcCNx4BBgUwA8qLHTlNqCWEMLwd3g TVodhiuDx16vDJ4o/624t3YoVc4+E9T7WPbaZdbEJgnIAajC5HNt/oYhD69Y6eB22BqP OiW+SI9fGwIqGJtM/16DF8wjKFUj7uaslvtGOw3XJx6xIBGzX8eFzfkpLe0HOqFgVkNC MNI/URsMaP4tsWYqbEo+zn++O6ya/BwEBd2GEh6unTcW7ZFtdIpEyyCvL7N91Pi/AE6C AYMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=N+k9FkkevXMRL26gpRwcgH/Ji1GNJNPZkiagil53+OM=; b=tLSAxuR3oRt9vgpWD8hg+cofaDgw5abgR343wSHH3F2PJxhd6Ce4oemuNS8G8WTG89 6sRRW1A7jmtSAIGj5xcBak/GiKK8mBrknfDh0ddv3KDrzeOa03yhiAbIQ1RzNO10GJqQ 7//JopWTQYJKHaT5N/Xxr1aQ7huRlKbUrf5aeBrvPVdW2JU9e+ZHoQ+CcRQp+UYO9pwY rNoJ4HiB61Azwppsp1rHlnvKl8UnV/9pUhWU+GQ8jtPDFtFGlUzSzBmVdpjVbMO8H4Y/ aBpu5TQ1aamRcheOkatWu353DNTsYPG5bvGxLWrUreoZEDlMVVhu5YUomV7CDYsWNoHX hTmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=BGxkZWbD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3si4309890pgn.376.2018.04.13.09.09.59; Fri, 13 Apr 2018 09:10:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=BGxkZWbD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752264AbeDMQIr (ORCPT + 99 others); Fri, 13 Apr 2018 12:08:47 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:59540 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750981AbeDMQIq (ORCPT ); Fri, 13 Apr 2018 12:08:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=N+k9FkkevXMRL26gpRwcgH/Ji1GNJNPZkiagil53+OM=; b=BGxkZWbD59TtEwRp/0TSr/Gt3N EmlrA2u48YPVbWywBQzmLyOhNnMWg1tRFe4hNTHeYHMpBOp5j2EedtPoXjLjSe0BVE3nvXM2s4ge7 IgDMZgNRqs8ex1WHNtCqZbcrwjrPbuBpzy9NkGndPv/JabXhIzlGWwxhAke9W6KNKoFTIqRj6GHI+ Qe1oBwCufFAvA52K3VUUC0zXIlLBF9Qk/Iu6x5G+pUir1qq4FdptppRkJUFNm0EQDKINsQKKEXNEE lNIt3w2oC+KD7dwt17AmaGAVSXzV5AeoNLwmtSd3zxi8bCRtPUnSw/isPv1Q9Lh/sYwrusIVi7hAp +kFB+gPA==; Received: from dvhart by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1f71FW-00023m-F7; Fri, 13 Apr 2018 16:08:30 +0000 Date: Fri, 13 Apr 2018 09:08:28 -0700 From: Darren Hart To: Kai-Heng Feng Cc: Pali =?iso-8859-1?Q?Roh=E1r?= , Takashi Iwai , Lukas Wunner , mario.limonciello@dell.com, andy@infradead.org, mjg59@srcf.ucam.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: Re: [PATCH v3 3/3] ALSA: hda: Disabled unused audio controller for Dell platforms with Switchable Graphics Message-ID: <20180413160828.GA27560@fury> References: <20180412104239.25584-1-kai.heng.feng@canonical.com> <20180412104239.25584-3-kai.heng.feng@canonical.com> <20180412105909.tbyfcjm55sb47hiq@pali> <93DC0F40-81A5-49C6-A470-0D1B6AA85725@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <93DC0F40-81A5-49C6-A470-0D1B6AA85725@canonical.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 12, 2018 at 10:15:41PM +0800, Kai-Heng Feng wrote: > at 6:59 PM, Pali Roh?r wrote: > > > On Thursday 12 April 2018 12:50:02 Takashi Iwai wrote: > > > > +#if IS_ENABLED(CONFIG_DELL_LAPTOP) > > > > +static bool check_dell_switchable_gfx(struct pci_dev *pdev) > > > > +{ > > > > + bool (*dell_switchable_gfx_is_enabled_func)(void); > > > > + bool enabled; > > > > + > > > > + /* Only need to check for Dell laptops and AIOs */ > > > > + if (!dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Dell System", NULL) || > > > > + !(dmi_match(DMI_CHASSIS_TYPE, "10") || > > > > + dmi_match(DMI_CHASSIS_TYPE, "13")) || > > > > + !(pdev->vendor == PCI_VENDOR_ID_ATI || > > > > + pdev->vendor == PCI_VENDOR_ID_NVIDIA)) > > > > + return false; > > ... > > > > @@ -1711,6 +1745,11 @@ static int azx_create(struct snd_card > > > > *card, struct pci_dev *pci, > > > > if (err < 0) > > > > return err; > > > > > > > > + if (check_dell_switchable_gfx(pci)) { > > > > + pci_disable_device(pci); > > > > Hi! > > > > Now looking at it again... This code disables all ATI and NVIDIA sound > > cards available in any Dell System (laptop or AIO) if system says that > > SG is enabled, right? > > Yes. > > > > > It means that also any external ATI or NVIDIA PCI card with audio device > > connected to Thunderbolt (e.g. via PCI <--> TB bridge) is always > > unconditionally disabled too? > > I never thought of this case, thanks for bringing this up. > Do you have any suggestion to check if it connects to the system via > Thunderbolt? Is there any kind of indicator for a PCI device if it is a removable device? Only disabling those PCI devices which are wholly integrated with the platform would be ideal. Failing that, is there an indicator in the PCI configuration which will distinguish such devices? Are the integrated devices using specific lanes, are the external devices behind a switch? etc. And can we do this in a generic way for all relevant platforms. -- Darren Hart VMware Open Source Technology Center