Received: by 10.223.185.111 with SMTP id b44csp1144776wrg; Fri, 9 Mar 2018 22:51:54 -0800 (PST) X-Google-Smtp-Source: AG47ELv4/NL1EcTKZQodc5h1LU87D9Ofk+wizQ7O/ECXZeTB4grpZSWMntnf4kJvAUgbqylX1rnI X-Received: by 10.99.103.196 with SMTP id b187mr982364pgc.1.1520664714166; Fri, 09 Mar 2018 22:51:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520664714; cv=none; d=google.com; s=arc-20160816; b=NpL8egPqy4x7qT2tgZl6xQMHbJM2zl5cDzQ8GG7sZVCilAcKmsqefNXKmig92t+Ngr ycHpXV1G2lN+g63tpDVcRhn7jc34O0Zb9yhfIcdwmgVfrlwupHNvDmvcwhHXhRm31lRa TthbySQ3IUmHv6cTM36r4UVdme1MQeSORWRLNDPiud2Ko9+Mh6qKsjen7/oyYw4+yeI8 4XCo1RMIPYZgjXvi/6OiokM6I2jP1/WCr0D6iLkj9r0kpujPOyAR23aSgLmilCvMd5Zd xDeZWf0JZnisvMj3qcMq7dcJmklmd88CiOMHRMnxHT9pxVMN1Rvd8Z3+Bv5jidBSP2OL 2bKA== 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=/t9OXgsY0zKwzQqUlEYLGvW0R2sxCbSlv9lXK0aPpwY=; b=BcNfAO3ARdXkhUCi074m0AL+f85IssYGL2QSySsj0uO4DLO0FzHvmI0bV4/MbrF2ii jYn2KDDECYUwYG1eGaaYhckV9QsHoz0UApfj2DvTCnKevpLW997opbXodqe1watfR67a 5gioTRQsnTfT9AfkdO4lw2pHi8KVCMx8ny3Qmzv+IWOAw55ccGAX7x78XeCoOKFmrgmo tCjrT6sBBJBx/4Gn4wEbvd1onWFJHUiuwx8+KvSfcmNuMS18bF5DdA+VeEzqkJnXfeCo KJkCqykm569VIIv1UomOc8pwV2Y6NbmwbdXELT3xUBvqdxWXUfGG74WRDar9Y9XQxkeL secw== 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 s4si2255237pfs.116.2018.03.09.22.51.39; Fri, 09 Mar 2018 22:51:54 -0800 (PST) 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 S1751751AbeCJGup (ORCPT + 99 others); Sat, 10 Mar 2018 01:50:45 -0500 Received: from bmailout2.hostsharing.net ([83.223.90.240]:46379 "EHLO bmailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751495AbeCJGul (ORCPT ); Sat, 10 Mar 2018 01:50:41 -0500 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 43FED2800B1C7; Sat, 10 Mar 2018 07:50:40 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id E8E7D31AEB; Sat, 10 Mar 2018 07:50:39 +0100 (CET) Date: Sat, 10 Mar 2018 07:50:39 +0100 From: Lukas Wunner To: Kai Heng Feng Cc: Pali =?iso-8859-1?Q?Roh=E1r?= , mjg59@srcf.ucam.org, dvhart@infradead.org, andy@infradead.org, Mario Limonciello , 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 for Dell platforms with Switchable Graphics Message-ID: <20180310065039.GA6633@wunner.de> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <723DA929-C9FA-4F69-8D3A-03D8A75D09A6@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 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 option > >>"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 (rev 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] Ellesmere > >>[Radeon RX 580] > >> > >>The Intel Audio outputs all the sound, including HDMI audio. The audio > >>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 (rev 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] Ellesmere > >>[Radeon RX 580] > >> > >>Now it's a typical discrete-only system. HDMI audio comes from AMD audio > >>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. 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? 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. 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=75985 If we decide to always expose the HDA controller on Nvidia cards, you may need to also match for the Nvidia vendor ID here. Thanks, Lukas