Received: by 10.223.185.111 with SMTP id b44csp39827wrg; Fri, 9 Mar 2018 00:23:25 -0800 (PST) X-Google-Smtp-Source: AG47ELtNWbyUIP8K8b7A3OZlNxKyAaONTKe7tZMtigrUrY/gGhIznLTsBbpzdJi5Gz/cNxUcMFg4 X-Received: by 2002:a17:902:7b90:: with SMTP id w16-v6mr26106454pll.26.1520583805268; Fri, 09 Mar 2018 00:23:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520583805; cv=none; d=google.com; s=arc-20160816; b=GdQDuq53RiUgjy9BjXt0ofI25xjndZ/nH0Ey613pZDz1UvSX4duslEpkGRFtX/qauI eVkmps3eLlMX1QZ84flF2O5EwKn22niGJ6NKWP52ply0GWQREkiTS2CuPl0xgEo9jnwt I7NacmubFpxzW0ISEBQgMvVfMRI4gkNaCHv5m/UbRRSI8uND2+QTFjdaaVeazgY/cRe7 XYd/6YJJnsrdqWW4FQQ3sUfWONwc/35N9GXwbSPC3O64zDaeH2dSgU06c4oJP5dDPP+D gI2/7pcgszDKux9NTKlFK1qo2gXWgApvCweR3e8keBtuZFL2is0DnYRcSA9NoxwVIDon bMUw== 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=h4e1xOoQCZKQmzBAUObmSgmfydk8e5a/eosHN7xkinE=; b=UmKYkgs8PnrFEgijGfsmVSCfFM6IFgy66Z44PsZmnhgApFtffABuoc/3fAiSklc52+ GwQWwFoayoxu+6dvq+v+S8meny11Z4kmiztKhDOOA/WANdZiKhVI4BeIrcZiRhnM5ex6 mKXJksuMeP9heXZxEwz7fg5wmFEn9Z4tkFyOCZ0otRhe7CXVnlY53FHHq+SFbysWDQhq GOlVeOhVH2JY0buFDRBteiOsICEGYNa/iYV053obkJz9rqf+0yKXIS2pGj7aXS6vFd3M yr6SpKwECeZo0eEtfLWLWICHmcEOmwI480PVPBhDQ1+b0kaKHV8fBwZl+2Vu7FAQ5Skv dz3g== 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 w4-v6si486951plp.122.2018.03.09.00.23.11; Fri, 09 Mar 2018 00:23:25 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751595AbeCIIWR (ORCPT + 99 others); Fri, 9 Mar 2018 03:22:17 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:38530 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751389AbeCIIWO (ORCPT ); Fri, 9 Mar 2018 03:22:14 -0500 Received: from mail-pl0-f71.google.com ([209.85.160.71]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1euDI5-0000dP-GA for linux-kernel@vger.kernel.org; Fri, 09 Mar 2018 08:22:13 +0000 Received: by mail-pl0-f71.google.com with SMTP id bb5-v6so4145156plb.22 for ; Fri, 09 Mar 2018 00:22:13 -0800 (PST) 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=h4e1xOoQCZKQmzBAUObmSgmfydk8e5a/eosHN7xkinE=; b=APOYixucFIIw7tJUsR6O54BmJKa6xXKeVWGNHGTI+f8rfoaCOLz2mP/dYjX+mNBlA/ 2wZJxaa6dHST+Q/VTjGFYmKYOoUlvYWOVlFWUp5jcfiWlRhcQuIxnLwoVpn0SqqNkCxQ z3P/4YMpAmRct96fK8Vh+QdNQsbueXP5Br8vpM7W3mEPSnDMhehb5SnnLLquDJXG2Gqf WjmoPreY7XoEX0WhszkTgk7h+qFTdWNp4XdQ36SG0ILD8FKX9SJ024bvkwXd6iD082P9 aE35WiecakZaPO8Amn5/SkkYk3UbB3Z2sP5NKChMgSZp2mUOCpO4CLMyKNhT3/6y4kqm G8AA== X-Gm-Message-State: AElRT7F6ffupuLXGmZSkSAfwH/Z1HP2v3L0A+I4Z9WROoZinDIdsVEe9 U94w3Yu0DoTk3oh6iaIQTO7x/qahpdX9oz88FTeDnhMDY1zMFHScE1aEUo9jrYk3JPYfHGfjU6Z acGjPV1YZE/3fbqczl0k8CjmR2PL+2nZ3/vqZVPqqcw== X-Received: by 2002:a17:902:b10c:: with SMTP id q12-v6mr10313052plr.197.1520583732172; Fri, 09 Mar 2018 00:22:12 -0800 (PST) X-Received: by 2002:a17:902:b10c:: with SMTP id q12-v6mr10313030plr.197.1520583731658; Fri, 09 Mar 2018 00:22:11 -0800 (PST) Received: from [10.101.46.95] ([175.41.48.77]) by smtp.gmail.com with ESMTPSA id c129sm1701750pfa.105.2018.03.09.00.22.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Mar 2018 00:22:11 -0800 (PST) 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: [alsa-devel] [PATCH v2 3/3] ALSA: hda: Disabled unused audio controller for Dell platforms with Switchable Graphics From: Kai Heng Feng In-Reply-To: <20180308113020.GA23073@wunner.de> Date: Fri, 9 Mar 2018 16:22:06 +0800 Cc: mjg59@srcf.ucam.org, pali.rohar@gmail.com, dvhart@infradead.org, andy@infradead.org, Mario Limonciello , tiwai@suse.com, alsa-devel@alsa-project.org, Linux Kernel Mailing List , platform-driver-x86@vger.kernel.org Content-Transfer-Encoding: 7bit Message-Id: <30D08909-0674-4D2E-8AF0-332A735FC245@canonical.com> References: <20180308091023.9061-1-kai.heng.feng@canonical.com> <20180308091023.9061-3-kai.heng.feng@canonical.com> <20180308093848.GA24068@wunner.de> <1A1B9259-DC5B-4C1A-96BD-7FCACDBFFBB3@canonical.com> <20180308113020.GA23073@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 8, 2018, at 7:30 PM, Lukas Wunner wrote: > > On Thu, Mar 08, 2018 at 06:38:45PM +0800, Kai Heng Feng wrote: >>> On Mar 8, 2018, at 5:38 PM, Lukas Wunner wrote: >>> On Thu, Mar 08, 2018 at 05:10:23PM +0800, 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! >>> >>> This should be fixed by the following series: >>> https://lists.freedesktop.org/archives/dri-devel/2018-March/168012.html >>> >>> Please verify that by testing the series on the machine in question. >>> I'm hoping to get those patches in for 4.17. I suspect that your >>> patch may not be necessary then. >> >> I no longer see the warning message with your patch. Thanks! > > Awesome, thanks for testing! > > >>>> Since the discrete audio controller isn't useful when SG enabled, we >>>> should just disable the device. >>> >>> I don't quite follow, when SG is enabled but hda_intel doesn't bind >>> to the AMD audio device, how are you going to stream audio to >>> external displays? Are external DP/HDMI ports muxed to the integrated >>> GPU when SG is enabled? >> >> Yes. It's a muxed port. >> The can directly output via integrated Intel GPU when SG is enabled. >> The discrete audio controller never gets used when SG is enabled. > > Okay, that's a crucial piece of information which I think should be > made more explicit in the commit message and probably also in a code > comment so that someone reading through hda_intel.c doesn't have to > look in the git history to understand what's going on. > > I'd remove the portion of the commit message pertaining to runtime > suspend and instead write something like: > > If Switchable Graphics is enabled, external DP/HDMI ports are > muxed to the Intel GPU and HDA controller and therefore those > on the AMD HDA controller shouldn't be exposed to user space. I'll add the explanation to both comment and commit log. Thanks for all the info. Kai-Heng > > Thanks, > > Lukas