Received: by 10.192.165.156 with SMTP id m28csp1664848imm; Sat, 14 Apr 2018 03:47:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx48Ey/WKsNXCs926EnTLCWSs7XICDI6AZtX6ol2tK/bY9aSR1G+qxVYkiXgKkS5ZAVa4PUug X-Received: by 10.98.162.2 with SMTP id m2mr6973684pff.251.1523702850747; Sat, 14 Apr 2018 03:47:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523702850; cv=none; d=google.com; s=arc-20160816; b=SbSsjvxXNBakRLgXXvlFrr6Qu44AR5P+7+Vc97iJ6PG7eDQVxPBQ7G9FVNtz8Fjzwz Ci7vM2aDKpAAY8S+jO3sR+/g1L078eduYEOmjEWvfu/G/sfVaVPSR3gaZRCPso7onKco r+QuhzJ0wkjyfIWHY/MJcM3jC9QSbVWchZ0oz7TM+48nhH5fVEAd4XS9Mhh9+74YTOgV 6NbEq0eHguL0D4VndKpTLS4AlGW1zS2gDupQGLyls3+bAgXq8t0Uxyi9gSeA3yo2RSkY mmy/0g9SoxSlSeB9Ty9eWF/ryW0pKeeE6wBvOxgN4qqTqPebr11OUbgzawOX7/KFUjD0 ulrg== 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:arc-authentication-results; bh=1EhNhLIB64rS8VrlkkJoWRpvQT9/rfOQcoY/TEU/Iqs=; b=KaIrU1jc4nTMy+THLa1zujzoYFIdZqcgdSTcG65tmnq/le+wvsc463h5zAzPlM8x4P 94aQUBeS0bxYi2bwBYlBef+Kx7D4vxVkHC5KQAO6DGtmCQa8kjLc3KqR9wDARylN76bS 3/ZVi+qfkIkJ1SRUPdIdEZXx75i4KG4Of4I4BHYgY5LzN5lVyPfRnF81t2YQW0bfKtt2 wBZ8B/teXmEYu6ceXBCC4LH2tqvcLjJXH/z0SAMUgw1w7UH5oKhPvR3UUgrcVDndyxAx vBmBdDkaVIYF+Vg/yanw1kBskbNmASLM/pUUzkuZHalDLCvq/SDRCUn0nqNmh/MBkfTh 84bQ== 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 bc6-v6si2001269plb.302.2018.04.14.03.47.05; Sat, 14 Apr 2018 03:47:30 -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 S1751030AbeDNKpR (ORCPT + 99 others); Sat, 14 Apr 2018 06:45:17 -0400 Received: from bmailout2.hostsharing.net ([83.223.90.240]:55401 "EHLO bmailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750880AbeDNKpP (ORCPT ); Sat, 14 Apr 2018 06:45:15 -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 6AD6A2800A28F; Sat, 14 Apr 2018 12:45:13 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 14DA41B540; Sat, 14 Apr 2018 12:45:13 +0200 (CEST) Date: Sat, 14 Apr 2018 12:45:12 +0200 From: Lukas Wunner To: Kai-Heng Feng Cc: Pali =?iso-8859-1?Q?Roh=E1r?= , 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: <20180414104512.GA27158@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <93DC0F40-81A5-49C6-A470-0D1B6AA85725@canonical.com> 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 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); > > > > 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? > > > > 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? Just use pci_is_thunderbolt_attached(), introduced by 8531e283bee6, like this: if (check_dell_switchable_gfx(pci) && !pci_is_thunderbolt_attached(pci)) > >>>+ /* 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; 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: $ 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 Thanks, Lukas