Received: by 10.192.165.156 with SMTP id m28csp2912417imm; Sun, 15 Apr 2018 12:07:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx48IrsJiGfuoA3qycfwmOf3PGqZbHFfVA0qGaIaoxH3LX6eJoqC9SXm6JPpUhixyE3K+3z15 X-Received: by 2002:a17:902:b081:: with SMTP id p1-v6mr13026048plr.31.1523819240190; Sun, 15 Apr 2018 12:07:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523819240; cv=none; d=google.com; s=arc-20160816; b=ESgWtJvNfMyooc2OhgMQllXOWnODtN7qZVX02Dm17Xoe5lnXkY7t17/fiIVb6U+g+7 vGZWpW2ttmPPfRr7+xUfkTtMNXDNEHKNZeVq8a/2QUW0+7RTCFSconBoJS9RNYGRiDpz RjCRUUffjzKueNwiiA+pahupJm+laFdo1pRUMPB1NqvtpA9zjs6Fka8SSV44IiMXFqp4 SnNcYi4i4kUWZr7DPbOKNpwZqZG38smKc+zY1zfgMHg2XFSnGqzyNkJKBrEmgH2DuB76 yWs7uQmb87p7PPsV2lnT2AhRy20EigDlTPd5+r9097wOPoMm5pyqLArWYcSl5a1BN/vw w9hQ== 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 :arc-authentication-results; bh=JEulJctmMcnJoHbugoOM2GWu3bF00vGLt2t8sVH6PQ4=; b=x9UeSxgneWeXMHrST4jt9LoEvIHMWyEqPHMbgCdFlk/1nl1cFOVO2kpUyM5kgasFPU Lg+JrzIBa8fWPrWG8m/QCydlgobiWvI1QdM5xQdZX8/PIIXWd5kNFd6rnPjY3qDu3zaj WuXs/f007ECSaeEZm5JBNtJEFeaF8Ov85kFtwaksCGXStMQDy82jVSIoYquN5kjWnJAq BRyjEvrbotcpgDSHspPBqkQSVmD0TWHPEN8vTDszfff56EsKSMgELrfUf3mqRT/bkvCr ShkBPJ7op9qido2Ktlo4Xl6JpwCYON4pnMi/j6FZpbGizyYZArbrVZ2RaLBBcn1894PE tnFw== ARC-Authentication-Results: i=1; mx.google.com; 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 b6-v6si10401477plm.202.2018.04.15.12.07.04; Sun, 15 Apr 2018 12:07:20 -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; 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 S1752802AbeDOTF1 (ORCPT + 99 others); Sun, 15 Apr 2018 15:05:27 -0400 Received: from bmailout1.hostsharing.net ([83.223.95.100]:45323 "EHLO bmailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752639AbeDOTF0 (ORCPT ); Sun, 15 Apr 2018 15:05:26 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 2767B30002229; Sun, 15 Apr 2018 21:05:24 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id E73101AF12; Sun, 15 Apr 2018 21:05:23 +0200 (CEST) Date: Sun, 15 Apr 2018 21:05:23 +0200 From: Lukas Wunner To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Kai-Heng Feng , Takashi Iwai , mario.limonciello@dell.com, andy@infradead.org, dvhart@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: <20180415190523.GA16129@wunner.de> 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> <20180414104512.GA27158@wunner.de> <20180414104950.ngomyjy5l5cwhb5i@pali> <20180414111711.GA4245@wunner.de> <20180415171746.futkvgbaoj6quy5z@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180415171746.futkvgbaoj6quy5z@pali> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 15, 2018 at 07:17:46PM +0200, Pali Roh?r wrote: > On Saturday 14 April 2018 13:17:11 Lukas Wunner wrote: > > On Sat, Apr 14, 2018 at 12:49:50PM +0200, Pali Roh?r wrote: > > > On Saturday 14 April 2018 12:45:12 Lukas Wunner wrote: > > > > On Thu, Apr 12, 2018 at 10:15:41PM +0800, Kai-Heng Feng wrote: > > > > > Do you have any suggestion to check if it connects to the system via > > > > > Thunderbolt? > > > > > > > > Just use pci_is_thunderbolt_attached(), introduced by 8531e283bee6, > > > > like this: > > > > > > > > if (check_dell_switchable_gfx(pci) && !pci_is_thunderbolt_attached(pci)) > > > > > > And what about PCI-e device attached to ExpressCard slot? > > > > I don't know of a bullet-proof way to recognize those. In theory > > one could check if the PCIe port above the GPU is a non-hotplug > > root port, but I think there are machines with hotplug capable > > root ports with GPUs below them that aren't actually removable. > > > > However I think ExpressCard-attached GPUs were rare, much less ones > > with integrated HDA controller, so in reality that's probably a > > non-issue. > > Hm... maybe another idea: Is it possible to detect which audio pci > device belongs to graphics card via vga_switcheroo? Currently, looking > at output it is same PCI device as graphic card, just different PCI > function. No, the DRM drivers don't filter ExpressCard-attached GPUs when registering with vga_switcheroo. They do filter Thunderbolt- attached GPUs. The ExpressCard 2.0 spec defines some ACPI stuff that *might* be used to recognize root ports that are ExpressCard slots, but I'm not sure how reliable that is. I don't have such a machine and have no experience with it. This is from the MacBookPro8,3 DSDT: Device (RP04) { Name (_ADR, 0x001C0003) OperationRegion (A1E0, PCI_Config, 0x19, 0x01) Field (A1E0, ByteAcc, NoLock, Preserve) { SECB, 8 } Device (EXCD) { Name (_ADR, 0x00) Name (_SUN, 0x01) Method (_RMV, 0, NotSerialized) { Return (0x01) } Name (_EJD, "\\_SB.PCI0.EHC2.HUBN.PRTN.PRT4") } ... } Thanks, Lukas