Received: by 10.192.165.156 with SMTP id m28csp1340194imm; Mon, 16 Apr 2018 19:40:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+wC0NK4N155k85330iY+KviVHs+ZvQ0o/N6r8kvjb8CItMdhDXvA/XQ+FjfloOFNjWoytR X-Received: by 2002:a17:902:848e:: with SMTP id c14-v6mr286943plo.95.1523932806003; Mon, 16 Apr 2018 19:40:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523932805; cv=none; d=google.com; s=arc-20160816; b=ONGmP52Wy9xxVXlsi9nr/oRdsZG9fj4wpCNraV/lPabKB30AMz31NICxGZJ1etVDBh IqLb0WkbyhHKtY00W1IMEPwBeb+BGwYW39Z0TkOhXwAGc+AnS8YWwL/NG1/ffx12AQrq 0MrT997RMOxFC+n/9WI3ERWxLkGveP0NJ8RgWxRi07sSoVLIK1u9Z1//uswVY47LPAOj vievVmKKTIdb3bkMDVRBOEjEoMRhw/5ZJPm2z+7+fOS4Pj4x2RgqbJmf3kuqaAMH1Bzv Tn5aW0ZKD/P73XPW5071yo/hhathu4VpI+TaW33SBxQTCPK5kXVvf8qRMt6GyIdUqLld cUEw== 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=F5ipf8xrTWPDm4oCzOq5QmuWapOMRKUGv3RDoTcxgF0=; b=V980iJcQC/CPhQQMr4OhssyCul2uA+j2RadRaniK6bXxDcuTF9n882+CJ13kfpO+ML AxuAN8HQRvUBhtEIpc9ZSTUsyh48f2+W4z/87MZnv9uA1PXdHGZdazqe7EeWC3o/mNG3 W7xMcXjM4uetyVhRu91ubBOKR24YoM3VZjZR55ONG1KGynDuzGCcKPkECEYA3/3/8/Tt ol+lgmey9FwRJzCMT2YiqwiAnG/Hdcm9sN227tES2pNx4hV/V5BRDyIjbqUGkYkI+zzS jelpptHvAwaAI0bpzYPSX3KAmk11nuaeeVqonJX0LMghS+qZfbf6YIYJRd3ZsSV2YBTz xACg== 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 s10si6365920pgq.162.2018.04.16.19.39.51; Mon, 16 Apr 2018 19:40:05 -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 S1752308AbeDQCid (ORCPT + 99 others); Mon, 16 Apr 2018 22:38:33 -0400 Received: from bmailout2.hostsharing.net ([83.223.90.240]:54021 "EHLO bmailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751086AbeDQCib (ORCPT ); Mon, 16 Apr 2018 22:38:31 -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 bmailout2.hostsharing.net (Postfix) with ESMTPS id 6C9E92800B4B6; Tue, 17 Apr 2018 04:38:29 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 1E07E12174; Tue, 17 Apr 2018 04:38:29 +0200 (CEST) Date: Tue, 17 Apr 2018 04:38:29 +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: <20180417023829.GA1533@wunner.de> References: <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> <20180416142512.bwsemgwrncyl5xan@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180416142512.bwsemgwrncyl5xan@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 Mon, Apr 16, 2018 at 04:25:12PM +0200, Pali Roh?r wrote: > 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. > > > > > > 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. > > 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. It is way simpler and more straightforward if hda_intel.c calls pci_is_thunderbolt_attached() directly, as I've suggested above. The DRM drivers call that as well and register with vga_switcheroo only if it returns false. So if hda_intel.c asked vga_switcheroo and got back a negative answer, it would never know whether it's because the DRM driver hasn't finished probing yet, or it's module is blacklisted, or whatever. > 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. vga_switcheroo doesn't do the filtering, the DRM drivers themselves decice whether to register with vga_switcheroo or not. The motivation is to avoid middle layers and instead provide the DRM drivers with a library of helpers that they may call at their own discretion. See this blog post and the links therein for background info: http://blog.ffwll.ch/2016/12/midlayers-once-more-with-feeling.html Thanks, Lukas