Received: by 10.213.65.68 with SMTP id h4csp209273imn; Tue, 13 Mar 2018 01:25:56 -0700 (PDT) X-Google-Smtp-Source: AG47ELveVh4ux9FFW4vYXkHiKA4kceztrZb9QD5YMM3TxewC/uDJrJZX3302zy5DfBkV8aLeQucD X-Received: by 10.99.60.6 with SMTP id j6mr5373690pga.73.1520929556030; Tue, 13 Mar 2018 01:25:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520929555; cv=none; d=google.com; s=arc-20160816; b=s39DQ0aDDPH2EkRC8cM0DGZRIlsDEs69She3rIX+On+vD9bppX6JhMlgUXQTy8+22z 4DjQ0Ru6e/YvdFSHlytQBynZmeBfwjE8pXmHqS4tkvYZzT0IuLShx/ECqqC1/OXPHcU2 15a1Hjq/yMqWk+oj3tyBYPoOlQ72xeDKlxWUcOvW0ZjjE3epcJo+H8zZgrKkHpZUfmTl 96kiriSlftw8FUPcgazB1aJXzxI2w6PPEJJuEDgHdHN+AE0blFv6z6cr71f++PloXIlV b5is3AZlNnf4O+Wx/vSR88znDlPic14GblW58RdT2c40VKpzP5QNx9A6irX/P74WY3UT a+tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:arc-authentication-results; bh=5kIQteU19av9blYerylbDd25FOjY4Jzfd2TuVXcI8aw=; b=nIh/lSrnwt9MW/3l/C3Gyp1kyUQMExwh+/oE9+FsxsIcOdcfkNe90z/RYE8DgKX0/T lVRc8OqH7AphDJUfpan2ge6VzvTWk/FKtwVDYfCb+9KYiSoRLZAdw+Yzxvn6538Rmcb3 EzKkZGbqvqRulhi6Z+8zXWtMWqmVV/RkzXfl3TBQgehCEMDgqIMx9zfHfQCY8fvoPNnZ YBLVh3xLbEGUFfqFgpPFAeNonLc+wBlztmBPQBqi6SB/Ed6tdgc2wbYU8BgRFkbcnXtN XbJscd4y8Jrgj6hGMCDX0AHleVgkBdFz5nm7sZ/sYeUYG+ZsqMwG6dUSWeikLeEOPA4Z OHgQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si7460981plt.124.2018.03.13.01.25.40; Tue, 13 Mar 2018 01:25:55 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752369AbeCMIYe (ORCPT + 99 others); Tue, 13 Mar 2018 04:24:34 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:48117 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752187AbeCMIYb (ORCPT ); Tue, 13 Mar 2018 04:24:31 -0400 Received: from mail-pl0-f70.google.com ([209.85.160.70]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1evfEU-0005Th-MO for linux-kernel@vger.kernel.org; Tue, 13 Mar 2018 08:24:30 +0000 Received: by mail-pl0-f70.google.com with SMTP id k4-v6so9901185pls.15 for ; Tue, 13 Mar 2018 01:24:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=5kIQteU19av9blYerylbDd25FOjY4Jzfd2TuVXcI8aw=; b=l3Yj7ZntocchUR0gUiRA+RlLhCpKgmQpSplbuTSEnAFrMlVMEWUrsaFsXF6DVziW6W sXA7SyD280HzXp5GRJQYzNJDE0igLsZHaLlnL8l7hrTsZHDJ/aPkrQLGR6cDe/CF2Yud T+ZkLH4hy4MbnVvYHA5MkIG8xQni2PUNBEddq8KZ4WGVRNc1Gq9CwH1O9cOEMQmOshG6 2g3B1C5E+/0FYDs3zdicg9vosGrWmMGXLI2dOxBohIbXQy9SVeq0maPom3OuE1oRzVLb HhrAY5jBCzaeVb7+Kbd6WkprNvaTtg3E1kRDeKXUcFvJfs5hgaWMxmCm5qEiJa5mwoXY No2Q== X-Gm-Message-State: AElRT7FFOTUD8w9xdoZRMY5srA0uNlfVw/14hyj9SVpUmZYKp9OTEvxc UaeZpFY6tFpXnPpl16ETz8ulPNCtBJoBRxGILJ+6ckO1mUqURbTgHALXICb48JYIJq3SsR3+9kP ySu6EFd6M+chgHLeodkuxoA8HdVXt8X3b6Kj5xPHGTQ== X-Received: by 2002:a17:902:209:: with SMTP id 9-v6mr2532141plc.403.1520929469253; Tue, 13 Mar 2018 01:24:29 -0700 (PDT) X-Received: by 2002:a17:902:209:: with SMTP id 9-v6mr2532124plc.403.1520929468919; Tue, 13 Mar 2018 01:24:28 -0700 (PDT) Received: from [10.101.46.95] ([175.41.48.77]) by smtp.gmail.com with ESMTPSA id z22sm19890944pfd.158.2018.03.13.01.24.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Mar 2018 01:24:28 -0700 (PDT) Content-Type: text/plain; charset=us-ascii; delsp=yes; format=flowed Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.15\)) Subject: Re: [PATCH v2 3/3] ALSA: hda: Disabled unused audio controller for Dell platforms with Switchable Graphics From: Kai Heng Feng In-Reply-To: <20180310065039.GA6633@wunner.de> Date: Tue, 13 Mar 2018 16:24:24 +0800 Cc: =?utf-8?Q?Pali_Roh=C3=A1r?= , 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 Content-Transfer-Encoding: 7bit Message-Id: <87BEDA0C-1821-4D2B-A4AF-FC89A434967B@canonical.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> To: Lukas Wunner X-Mailer: Apple Mail (2.3445.6.15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Mar 10, 2018, at 2:50 PM, Lukas Wunner wrote: > > 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? It does, but the audio controller only shows under SG disabled. > > 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. This is how the Nvidia variant works: When SG is enabled: One audio controller, the integrated one. All sounds comes from the integrated one, including DP/HDMI. When SG is disabled: Two audio controller. The DP/HDMI sounds come from the Nvidia audio controller. Others are from the integrated audio controller. > > 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 The system in the bug doesn't have "Switchable Graphics". Right now all sounds output are from integrated audio controller on SG enabled machines. > > 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 for the info, I'll also put Nvidia vendor ID on next patch version. > > Thanks, > > Lukas