Received: by 10.192.245.15 with SMTP id i15csp1183141imn; Sun, 11 Mar 2018 07:07:31 -0700 (PDT) X-Google-Smtp-Source: AG47ELtEVPOFkCyqxbhG89rLqoizS80ockyJDqop1qYYwEe1LdF8Hzrz2SoflkcoN4aojnlRwAHF X-Received: by 2002:a17:902:a607:: with SMTP id u7-v6mr4931388plq.367.1520777251075; Sun, 11 Mar 2018 07:07:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520777250; cv=none; d=google.com; s=arc-20160816; b=KFBnC8sqmF9DDXDPJCMFBDWR1/hR/AcuxKNBr3avnV+93zoAlIBKPQiduAWvpfZv9h Dl47UcRNP6BK7e62IBK7NnUpeCBFXTmkhMg4Get5HguZoJK8pyvUdCMYTOdTO3NSEOeb XgPf0G3ThjfOCvcPT+T3taGdDryJJy8J5wM+HtIRxBGTxTjWdleuA6CAaZqc6xhClg67 tEAO4JqZzns89nuLq9CuxdzBp0PgJHr0AxwQBT2PN/mwPQZRp6yCJLtIsDGaUKnO3ThT xDDm+ytWrqCVnk2h3mbLJVmhRa58R+bds6GaO7rLcUoIohC3pjPBu0smhXA7DU1KPCAU rnQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=b0HlytpnI9IGiAys57+sxLuR9Si1ZBjrY1jtdfwmjsA=; b=JxIQp/xV1NAZZUGsz+8eUuJFhm+TT2H60ptLQ4NW/ezTEJKO4PtmDqnmU6hYxcQ0AZ mTTM4Ar+3MegIIgL/F/0yIMxMZeOMwk2rKgGgFQ1F9G5nx0T5ch3JhmzkFGoyV+ClnOS 11GFbnOAXaXC5DI9s9A17HDiarKs0cJv84cqyoVhIFQkcLyj4lNkVrhjr44nXbAFOZ+Z q2M9YWKIcksbcw+LPSDAVJ8mwLEP/+h0bpjBpdZ+m08ddPZ01r4inY4La34NuapBsYwq 0GFgCJgk1hNr2SczO8C3D+2W1eAixqw45cQzKyYpy1hB/Nl65Lg43M41ZxD76yDlWelz FGaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@dell.com header.s=smtpout header.b=VzOYoMxT; 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=fail (p=NONE sp=NONE dis=NONE) header.from=dell.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h193si3650574pgc.591.2018.03.11.07.07.15; Sun, 11 Mar 2018 07:07: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; dkim=fail header.i=@dell.com header.s=smtpout header.b=VzOYoMxT; 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=fail (p=NONE sp=NONE dis=NONE) header.from=dell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932240AbeCKOGZ (ORCPT + 99 others); Sun, 11 Mar 2018 10:06:25 -0400 Received: from esa7.dell-outbound.iphmx.com ([68.232.153.96]:6727 "EHLO esa7.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932136AbeCKOGX (ORCPT ); Sun, 11 Mar 2018 10:06:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1520776947; x=1552312947; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=KXXRcAXtcUwtHHU2NMSgcyvH8HOuAumvoqkS8iaKkXY=; b=VzOYoMxTYvp4/XBYBiPc17/VASD3aFAyKCVK2Vy4ZWcnqgHyq8KW/ITB 2cl+pB5zLUkRMhU3lNslaEwnbFxbJMVFTorlgtGZRJdB1NKd7yof1SmbW /rglEx5eRghhb9fAYgQeH++Fu07wgxGiVRXAMNRnI//oc2FNs9dxAOVaR o=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2GaAAC1N6Vah8mZ6ERdGQEBAQEBAQEBA?= =?us-ascii?q?QEBAQcBAQEBAYQmEG8oCo1ljW+CBIEWhySNDoIVCiOFAgKDESE0GAECAQEBAQE?= =?us-ascii?q?BAgECEAEBAQoLCQgoLoI4IhFLWQEBAQEBASMCDV0BAQEEbgsMBAIBCBEEAQEBI?= =?us-ascii?q?wQHISUJCAIEAQ0FCIR4AxUPq3KHHA2BMIIVBYU1gi6DPIMugmpEBBmBXYVjBI1?= =?us-ascii?q?/L4t3MQmGQ4Zpgy2Oa4l5OYcWgSweggtwT4JDgjIQDBaBY3cBiR8qgQeBGAEBA?= =?us-ascii?q?Q?= X-IPAS-Result: =?us-ascii?q?A2GaAAC1N6Vah8mZ6ERdGQEBAQEBAQEBAQEBAQcBAQEBAYQ?= =?us-ascii?q?mEG8oCo1ljW+CBIEWhySNDoIVCiOFAgKDESE0GAECAQEBAQEBAgECEAEBAQoLC?= =?us-ascii?q?QgoLoI4IhFLWQEBAQEBASMCDV0BAQEEbgsMBAIBCBEEAQEBIwQHISUJCAIEAQ0?= =?us-ascii?q?FCIR4AxUPq3KHHA2BMIIVBYU1gi6DPIMugmpEBBmBXYVjBI1/L4t3MQmGQ4Zpg?= =?us-ascii?q?y2Oa4l5OYcWgSweggtwT4JDgjIQDBaBY3cBiR8qgQeBGAEBAQ?= Received: from esa1.dell-outbound2.iphmx.com ([68.232.153.201]) by esa7.dell-outbound.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2018 09:02:24 -0500 From: Received: from ausxipps301.us.dell.com ([143.166.148.223]) by esa1.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2018 19:57:09 +0600 X-LoopCount0: from 10.166.132.172 X-IronPort-AV: E=Sophos;i="5.47,455,1515477600"; d="scan'208";a="147516033" X-DLP: DLP_GlobalPCIDSS To: , CC: , , , , , , , Subject: RE: [PATCH v2 3/3] ALSA: hda: Disabled unused audio controller for Dell platforms with Switchable Graphics Thread-Topic: [PATCH v2 3/3] ALSA: hda: Disabled unused audio controller for Dell platforms with Switchable Graphics Thread-Index: AQHTtr1XC+3UjKIddE2I55hGuXPKiaPIAceAgAAHyYCAAWW9gIABpsRw Date: Sun, 11 Mar 2018 14:06:15 +0000 Message-ID: <12df9a905ea842498e3fba492fdef59e@ausx13mpc124.AMER.DELL.COM> References: <20180308091023.9061-1-kai.heng.feng@canonical.com> <20180308091023.9061-3-kai.heng.feng@canonical.com> <20180309090223.xb55ltac4pfesdrh@pali> <723DA929-C9FA-4F69-8D3A-03D8A75D09A6@canonical.com> <20180310065039.GA6633@wunner.de> In-Reply-To: <20180310065039.GA6633@wunner.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.143.18.86] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Lukas Wunner [mailto:lukas@wunner.de] > Sent: Saturday, March 10, 2018 2:51 PM > To: Kai Heng Feng > Cc: Pali Roh=E1r ; mjg59@srcf.ucam.org; > dvhart@infradead.org; andy@infradead.org; Limonciello, Mario > ; tiwai@suse.com; platform-driver- > x86@vger.kernel.org; Linux Kernel Mailing List ; alsa- > devel@alsa-project.org > Subject: Re: [PATCH v2 3/3] ALSA: hda: Disabled unused audio controller f= or Dell > platforms with Switchable Graphics >=20 > On Fri, Mar 09, 2018 at 05:30:15PM +0800, Kai Heng Feng wrote: > > >On Thursday 08 March 2018 17:10:23 Kai-Heng Feng wrote: > > >>Some Dell platforms (Preicsion 7510/7710/7520/7720) have a BIOS optio= n > > >>"Switchable Graphics" (SG). > > >> > > >>When SG is enabled, we have: > > >>00:02.0 VGA compatible controller: Intel Corporation Device 591b (rev= 04) > > >>00:1f.3 Audio device: Intel Corporation CM238 HD Audio Controller (re= v 31) > > >>01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. > > >>[AMD/ATI] Ellesmere [Polaris10] > > >>01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmer= e > > >>[Radeon RX 580] > > >> > > >>The Intel Audio outputs all the sound, including HDMI audio. The audi= o > > >>controller comes with AMD graphics doesn't get used. > > >> > > >>When SG is disabled, we have: > > >>00:1f.3 Audio device: Intel Corporation CM238 HD Audio Controller (re= v 31) > > >>01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. > > >>[AMD/ATI] Ellesmere [Polaris10] > > >>01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmer= e > > >>[Radeon RX 580] > > >> > > >>Now it's a typical discrete-only system. HDMI audio comes from AMD au= dio > > >>controller, others from Intel audio controller. > > >> > > >>When SG is enabled, the unused AMD audio controller still exposes its > > >>sysfs, so userspace still opens the control file and stream. If > > >>userspace tries to output sound through the stream, it hangs when > > >>runtime suspend kicks in: > > >>[ 12.796265] snd_hda_intel 0000:01:00.1: Disabling via vga_switcheroo > > >>[ 12.796367] snd_hda_intel 0000:01:00.1: Cannot lock devices! > > >> > > >>Since the discrete audio controller isn't useful when SG enabled, we > > >>should just disable the device. > > > > The platform does have a NVIDIA variant, but the discrete NVIDIA have a > > audio controller, hence it doesn't have the issue. >=20 > Sorry, I don't quite understand: The AMD variant *also* has an audio > controller, so what's the difference? Or did you mean the Nvidia > variant *doesn't* have an audio controller? >=20 > Pretty much all modern Nvidia GPUs do have an integrated HDA > controller, however it's possible to hide it by clearing a bit > at offset 0x488 in the GPU's config space. Some BIOSes hide > the HDA if no external display is attached. >=20 > I could imagine that the BIOS of the Dell machines in question > hides the HDA if Switchable Graphics is enabled. If that is the > case, be aware that there's an ongoing discussion to always expose > the HDA controller because the behavior of some BIOSes to only > expose the HDA when a display is attached causes massive problems > with Linux' HDA driver: > https://bugs.freedesktop.org/show_bug.cgi?id=3D75985 >=20 > If we decide to always expose the HDA controller on Nvidia cards, > you may need to also match for the Nvidia vendor ID here. >=20 Like I said I don't know the details on why NVIDIA isn't affected, Kai Heng will need to comment here. You might very well be right. I stand by my point that the heuristic makes sense for what exists In the kernel today though. If the point you mention is the reason why NV isn't affected and this changes in the future it's a simple extra || to match NV cards too, or to remove the AMD part of the check and just look for Dell subsystem vendor instead of AMD product vendor and Dell subsystem vendor.