Received: by 10.192.165.156 with SMTP id m28csp1667244imm; Sat, 14 Apr 2018 03:51:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx4970RbaY+CJJCsaUZw2Ix8BqxUJcUll36aCRbcs1KG1soLfzMDV4FNeux74TJd7L2ZM06Cy X-Received: by 10.99.97.16 with SMTP id v16mr691526pgb.292.1523703075104; Sat, 14 Apr 2018 03:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523703075; cv=none; d=google.com; s=arc-20160816; b=unc9AjnB636Vd07fGWXYZvIWA3nyXYIZ0PaATfZkuv0Fs/wqHgew5Y2OcFT9KRI7Vo s6egdAlAOZOs9rG3IufY5RjFjaUhYeXZ/VoK5pWMdwGbRqUTHUMMSZUK2KmEHL+XEoSO tlayPPRNgC1DLDZqJjatiO2tG/Vgn3HbPVXpvT/nOVNaslYwjczLtjhUrfyWuLRgA5Ft oMsJBCHFvaW1CVk2aSnLWtcOAmZkYruOx4Xy3RyguIHvS78dN9BN54Mnv8P+dEpR88qm bIqDu7hRNadaPWnUW414R5RsxiwKnHe5o30kjT694EWEjD7KIr2ms9yCCLkzHX2BB5k6 79UA== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=VTblIil970utWV0WbqFbhsrhK01goxYQvzW0KIYjojw=; b=P5iwPP60Pp6lrzsZQQBW8nhq2PFFAyzL6gQIj/ZIpH1zE0n5lqbkWAHU9BAHBbBYb7 eAbnxAiI3RUM5a/73f1cMdqD26o9e1zUFMMC8yaziBGbXfYlwOioH7nQF6pAEgbwtFXl NKEr4cmNd+9mYcurydFJLsmNEQf5jp3tdRm/LYda8M34vzyxNu3LdKZ/mNMxkpQRKJeO bDXCfyMUXrCBQswCU6TWWzGAKg16k2T6KODMG9EvhSbzdFIxYOm3RdPxa4TmMf/HzRBj YQ+CYIHrgwUSScl4UMz8U1iI8F5UUAxb2h2Mmcna1lnik1uzapWzTrhY0ImGbzO+X9ml daXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OcCgx/b0; 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 68-v6si2137880pla.531.2018.04.14.03.51.01; Sat, 14 Apr 2018 03:51:15 -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=OcCgx/b0; 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 S1751026AbeDNKt4 (ORCPT + 99 others); Sat, 14 Apr 2018 06:49:56 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:42618 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750880AbeDNKty (ORCPT ); Sat, 14 Apr 2018 06:49:54 -0400 Received: by mail-wr0-f196.google.com with SMTP id s18so13975280wrg.9; Sat, 14 Apr 2018 03:49:53 -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:in-reply-to:user-agent; bh=VTblIil970utWV0WbqFbhsrhK01goxYQvzW0KIYjojw=; b=OcCgx/b0vExmWzG/JjNDAAiqtZc7vrm/jFGaeBCg/B/tzNpsggb71FUhdTcyL7P25G aboLEwrif94B0Zmrgv8niRH9X8s7fOP90Y+BdwWjOrzmDRvKibuF5qPiU/WKYdPTUtUt Z+9raSk0SfGtsqss93De2/P9vcbHmLMTa4Mh/IbrAoC2w7V7OBqkDhfMDuno+uhoOJ+o f9Dit8ZO96eQqqalJvo02kIL1tXi0mJax4MlO4PESgzFoVo6npiAhgnm5kQ6+vuqUtZq vs+2ncANy1h4j5L43piOhb+oEQ5WqXaK74qKzDJBkLh46TpZTfu9kwkdG+kwW+V9zOqy DQfQ== 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:in-reply-to:user-agent; bh=VTblIil970utWV0WbqFbhsrhK01goxYQvzW0KIYjojw=; b=sWQ6r/s/uX01cHJXP5dWbhn70Zauf1n/L96LL1F0NmaKzZDVyP1Vv+aujiQvWViwKn qDEVkA27Sj0a3vaF678GzT75G8n9EFoE7JUQuilQdhrwxHtC2zGUj26CTS/UH7oogZQe clmAos9aYYPDp7PzvUnK9ZqRkoAZJXwux9pfqoIT/MH3Gl8aP6DmNLfDrJxnY7NYh3DH YFEnfAmSW8ZbGsAjRBJSiCff9BWk5k5BoZXRSEUPJlnOE7Hca6/OoYVayGuJOEz2XH+f X+OJZydbCP+9Al8Vxqg9hxhJB99UNin70S0aJOLdg6gz8u9B7ll1tnoKdsEollSHUmhb YYHg== X-Gm-Message-State: ALQs6tAuGDRvS2pwQNm3Fen/hiwt8++jMITwLNs4eGox3gy7wwfDVpXX +H3GycvFs6fI2IpvWWyCoNY= X-Received: by 10.223.219.10 with SMTP id s10mr5736872wri.241.1523702992814; Sat, 14 Apr 2018 03:49:52 -0700 (PDT) Received: from pali ([2a02:2b88:2:1::5cc6:2f]) by smtp.gmail.com with ESMTPSA id n8sm8658703wrh.51.2018.04.14.03.49.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Apr 2018 03:49:51 -0700 (PDT) Date: Sat, 14 Apr 2018 12:49:50 +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: <20180414104950.ngomyjy5l5cwhb5i@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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="li3pzsurnzk4x4tk" Content-Disposition: inline In-Reply-To: <20180414104512.GA27158@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 --li3pzsurnzk4x4tk Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: > > > >>@@ -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); > > >=20 > > > 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? > > >=20 > > > It means that also any external ATI or NVIDIA PCI card with audio dev= ice > > > connected to Thunderbolt (e.g. via PCI <--> TB bridge) is always > > > unconditionally disabled too? > >=20 > > 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? >=20 > Just use pci_is_thunderbolt_attached(), introduced by 8531e283bee6, > like this: >=20 > if (check_dell_switchable_gfx(pci) && !pci_is_thunderbolt_attached(pci)) And what about PCI-e device attached to ExpressCard slot? > > >>>+ /* 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 =3D=3D PCI_VENDOR_ID_ATI || > > >>>+ pdev->vendor =3D=3D PCI_VENDOR_ID_NVIDIA)) > > >>>+ return false; >=20 > It sure would be nice if someone could add macros for the chassis type > to include/linux/dmi.h so that we don't have to use these magic numbers > everywhere: >=20 > $ git grep -l DMI_CHASSIS_TYPE > drivers/firmware/dmi-id.c > drivers/firmware/dmi_scan.c > drivers/input/keyboard/atkbd.c > drivers/input/serio/i8042-x86ia64io.h > drivers/platform/x86/asus-wmi.c > drivers/platform/x86/dell-laptop.c > drivers/platform/x86/samsung-laptop.c > include/linux/mod_devicetable.h > scripts/mod/file2alias.c >=20 > Thanks, >=20 > Lukas --=20 Pali Roh=C3=A1r pali.rohar@gmail.com --li3pzsurnzk4x4tk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQS4VrIQdKium2krgIWL8Mk9A+RDUgUCWtHcygAKCRCL8Mk9A+RD UrpSAJ494oA3o0/1MGVtCDcKfNdvpJ9h7gCdGmvlaP/qVIu6pX2MuqsFKA2fh/s= =YVP3 -----END PGP SIGNATURE----- --li3pzsurnzk4x4tk--