Received: by 10.192.165.156 with SMTP id m28csp716671imm; Mon, 16 Apr 2018 07:37:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx49mURZ5hQLCGDCM0Y5c9dLIuHflQHkvKy5R8UmT/basRPJq4O9cf4fNc7GDkuV1u+kCGkiL X-Received: by 10.98.102.79 with SMTP id a76mr21775335pfc.162.1523889440814; Mon, 16 Apr 2018 07:37:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523889440; cv=none; d=google.com; s=arc-20160816; b=GaVZ8VIh03aekkLm/eiM27o3McVZmR8uMZKefpetIIR/CM7DoKHd90ZOiThbqKdA11 LAvj5pTN+kS0O2OkxgtGnyBg0IlSJ5ovCTmFXBFCPqkbDrEhIk9tlsmGUKBfEzjJSWm5 rDoi2rQv3Ul0XrJ7aIuSMwhZTepIJGnAARRjGQnWclRU0Bi/iO/mrYuyJ1tGKi1N5VKD N8PiLco1ZKLsBqIb+kY1yy8TToO7e8034T7FUoZEiytn/BZGkUGR/0ljIoCVFpWeYgDQ v/ZIh+87MnBS3oMvZ8nn4AuQgORe4nwHfBU8qE7dhfw5zGOrkACdjMLU8jPD0lnJ6ywD FTZA== 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=qMIQgHp+mco4ygI1GhFfVDNwT4eAhNISGrG2M/865ic=; b=eNxusyN2oDd7VSwFPT+m7PM8kTNeog0lv+F1UrYG/1Fz8BBV7d3oFqh3gyp9HfG5St 8MxeLEd2G8J+Xn3FZgNcVDu5zMe/CJzvs9q0zptvvKZAbZxcEPnvKfdCoEm4K9xbswPm cgupgA3qUdRqYcQwC7a2L26S7/b8gyYdmaC/f9UDxTqZPlm0zx7v4k1TJuTJbr8ndpc8 Ywe9J2EzNUQpm99rjWUN+KlOhmdu1RRlszfitzKuKKWbDgxVVIb3/poMNnQ29zxhk6y6 bnmfoRpytQESPm+5Ty/eN4DE17tZ1Ki8udtlbKrhapfZOPOMVJJxqcxYjZutUBg2uAkx M/Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Jo+OfHp+; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z30si11131430pfg.140.2018.04.16.07.37.06; Mon, 16 Apr 2018 07:37: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Jo+OfHp+; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755424AbeDPOZT (ORCPT + 99 others); Mon, 16 Apr 2018 10:25:19 -0400 Received: from mail-wr0-f179.google.com ([209.85.128.179]:35310 "EHLO mail-wr0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755291AbeDPOZP (ORCPT ); Mon, 16 Apr 2018 10:25:15 -0400 Received: by mail-wr0-f179.google.com with SMTP id w3so9974994wrg.2; Mon, 16 Apr 2018 07:25:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=qMIQgHp+mco4ygI1GhFfVDNwT4eAhNISGrG2M/865ic=; b=Jo+OfHp+BMOn1/cjCYX0/JIf1ErANYsqJrFZSKOYB79qF0RKVCTFipmYIdsT/9HaC0 F5KdC4rg8Oz2GDW8PFLFcBzUSCUQiarcr6HqF9qfNcM+NKaisR1jG3RnbJoqKM6cnvrd LIjC0hq2qAn1JExF/2W+xajWQt1KGck61DxArgczBaTCYDU33QNe6s94UKtFA5g0c37S 9KJBSTx95/dw4V0soiOdyDFxCsHWy1ZSFUkRQHpxf5/XDuDjlAoG7LXF75Fz5HBdDjSB XsavsU3/hTH6Np83a2HlKW3UWYSPCwS7yab4e0Z31U6egaRdEoAPYjXLCxm4Pa4bQ2Qj d2Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=qMIQgHp+mco4ygI1GhFfVDNwT4eAhNISGrG2M/865ic=; b=bxo+9tGW/5jeFkvU/TXd9wFwyMNsxMxoZtbLajSfB2aqzZucuU/uKnDmG4qgkLwUIJ 94mIkgrkyXK2sV4xVwha9CaFsOAJXHJdwAmd/daVdsu9rO8w84yQogRQyxC3YZ4JObZQ 9ir/peqFDAiRBU9Mt+SoIha9aCwrs1H2y0kI1H6VODYRV+7WDr1GWbDgdbK4ecPemWhE tl95u9nngWgs+Aq1T3Ep91m+PA3VIZN4TJyHGfKHIOu/10xgoHXrek5q2uaHsgb+Y2Ig PwdIMF6wKFg+16DG/t1wsz1bc/b5ElIenMqHEeuW8UMYUGBzCxn6evMPSz+z3dmRTTYW KYIQ== X-Gm-Message-State: ALQs6tBQp7DrJobxPJu4X1RXLBVfO6VJjwzrktuM+0fnxOtA7rzXOO+S 3DbTMEDs2K0hBp6dgx7dZq8= X-Received: by 10.223.160.4 with SMTP id k4mr10917089wrk.259.1523888714003; Mon, 16 Apr 2018 07:25:14 -0700 (PDT) Received: from pali ([2a02:2b88:2:1::5cc6:2f]) by smtp.gmail.com with ESMTPSA id c21sm11087257wre.43.2018.04.16.07.25.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Apr 2018 07:25:13 -0700 (PDT) Date: Mon, 16 Apr 2018 16:25:12 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Lukas Wunner 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: <20180416142512.bwsemgwrncyl5xan@pali> 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> <20180415190523.GA16129@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180415190523.GA16129@wunner.de> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sunday 15 April 2018 21:05:23 Lukas Wunner wrote: > 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. So check via vga_switcheroo should at least work for Thunderbolt 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. So for EC we do not know or have reliable detection. I do not know if it is possible, but for me it looks like that check via vga_switcheroo should be better then adding another heuristic to other drivers. Lukas, what do you think? And it is possible to use this check for detecting audio device? And once we would have good/reliable check for EC devices we can add it into vga_switcheroo and all users of it could benefit. Anyway, I think that vga_switcheroo should filter also EC GPU cards if it already filters Thunderbolt. > 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 -- Pali Rohár pali.rohar@gmail.com