Received: by 10.192.165.148 with SMTP id m20csp3163434imm; Mon, 23 Apr 2018 01:30:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/TGvWaM7jfR30Z6nqwgGnLWDhJyXcx3bgwJ/elma/Ay6ui4Rram368/edAe5Be57oAOgXn X-Received: by 10.99.37.196 with SMTP id l187mr16441353pgl.221.1524472252266; Mon, 23 Apr 2018 01:30:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524472252; cv=none; d=google.com; s=arc-20160816; b=Gkk++Cj9ryGX+Wg6qQvBxScLgUCb9HEaj41IjQ3rzr7xCCDCBQKEsSoPFHv8ZhXx7E B9cmdxmXD/OJTD8dZZ8AHVCbFiIOeiecDEBYAxScJMwGbsHQ4MoiA8pJnpKiTKR9W8dh g/i+Z/jdceMBrM0spzbHo6x8tfsglY8TJ/xmMe5sNayXhlxXU2ywN500KHJwdbYGKZzN YKAyxsHuWrExQmM+/bYBOb6lhyNqUiMBau5TxtmVye3KzugL/jmHG2/ILJfw/ZrOqSQ3 7TbO59qQWULeyQdzfxz9Rv1xWVsKvIGyBrzj6vSR+HVjzo4nJHOO8mkc14au1dCWvT2J kHEw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=idsZIkIksxs+3zSesbuiOwAQRKNpUnBDiU6sOn4gHaE=; b=f945RSUXRtpR1RvazEjNm/i9U8Jq5ZzXXIIpdOwav9SIHGf9tTCkJK+KhIYHIUZ0ci x49c0U4DQIzh2YbD0tTCVkt2cxoc4zeaVRA9JIaeMyDeU82XSKLxMZEAscFnuxySHplK UgehwHMO0po3gDpoHpu8rW1OER6+ajsJPqtGFAhFp2lZs+e9JuT2dyL9OpC7x0HOGqkY 7rbbdTx2lsW2Uv22OUPl+ikA42utr7MMAP0Cyq9p7PgbucatGSeko5XRetRTXsXyuPC2 WUyQi1bD2gtlscjIXHFQV0q2lvd8nMoiVjmIVGBB69RrkvAQl5pew32f+fgxu9tr3i1A 1x9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jZigpJVw; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 30-v6si8834102plf.104.2018.04.23.01.30.38; Mon, 23 Apr 2018 01:30:52 -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=pass header.i=@gmail.com header.s=20161025 header.b=jZigpJVw; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754425AbeDWI3e (ORCPT + 99 others); Mon, 23 Apr 2018 04:29:34 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:35311 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754010AbeDWI3b (ORCPT ); Mon, 23 Apr 2018 04:29:31 -0400 Received: by mail-wr0-f194.google.com with SMTP id w3-v6so38702790wrg.2; Mon, 23 Apr 2018 01:29:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=idsZIkIksxs+3zSesbuiOwAQRKNpUnBDiU6sOn4gHaE=; b=jZigpJVwspKPM2btGG61b0sq255H3Ig34LNVmFfkFHTColKmvlFhH4g5IYA+N8LMk2 kIEcsn9xGslXx0mfmaW06s0VfUEYnXUeOvUD05EwUgUqiMIvAED77e8Q2VxtWnP2BvPr zQ9ZAFFHLwLEWiMjJT7PR7Y2WJO2W8/IYPn0kZ/MNXUPnGYKV/K378/9JKTxGuGVGcEv Voxs1Kbekg7bIswhuX2VlsEJcDfqRXmZb7c7vc+9oAv9eHuDIqEgg3MS9L40e4zfO0mb F1PeOIiPwuulbHUh0PC1UoJA7+SFHp/rvIJZHoQnDlvKNxL1sxfjkw0XdznavBn4BX/e IM2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=idsZIkIksxs+3zSesbuiOwAQRKNpUnBDiU6sOn4gHaE=; b=W9187S3pkhng2OyWqglL4M2bPyYjLvVABUGqMUHLqU1mr2PpV87cS3jZ/R+Oh3EXko 01mXlekdW4S82jS466ts7J4os98D0irVtqsXULGv7tLD0WG9wmcCcrr4Y5nlZvhwcht8 To7b/3gBOmd64BpJM8EdEAM9D+brkeE4ch6ayxm86C3lFXHYJlNDId8aLI59qJV/Y2po OLi4RMcU0r5g7zwWGE/XO8oEjlfeBI/v1aVmLvJFynPPE26a5nmzBwCG4+N8Hu2xY/wY RoY5S3I0AcHpUgfEdvuUkTrbDBnSOzGCGWbGJoulw3lLmrPV9r6KdTy7PUgyiEVGlMWj kpow== X-Gm-Message-State: ALQs6tBlr2B/W4lkdyjTwWXolM5NN8ERIJSARgjjVBGaOBlhxhreKIJm 0JiUGkKy2z2iubSkR2CDVdw= X-Received: by 2002:adf:c6c7:: with SMTP id c7-v6mr15716434wrh.104.1524472170393; Mon, 23 Apr 2018 01:29:30 -0700 (PDT) Received: from pali ([2a02:2b88:2:1::5cc6:2f]) by smtp.gmail.com with ESMTPSA id r19-v6sm10759205wrg.8.2018.04.23.01.29.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Apr 2018 01:29:29 -0700 (PDT) Date: Mon, 23 Apr 2018 10:29:28 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Kai Heng Feng Cc: Takashi Iwai , mjg59@srcf.ucam.org, 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 Subject: Re: [alsa-devel] [PATCH v4 3/3] ALSA: hda: Disabled unused audio controller for Dell platforms with Switchable Graphics Message-ID: <20180423082928.po6tgq7gbz36pe7b@pali> References: <20180420094432.13133-1-kai.heng.feng@canonical.com> <20180420094432.13133-3-kai.heng.feng@canonical.com> <20180423080844.yh6ndicpu6mwy336@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday 23 April 2018 16:18:35 Kai Heng Feng wrote: >=20 >=20 > > On Apr 23, 2018, at 4:08 PM, Pali Roh=C3=A1r wro= te: > >=20 > > On Monday 23 April 2018 16:04:55 Kai Heng Feng wrote: > > > > On Apr 20, 2018, at 8:10 PM, Takashi Iwai wrote: > > > >=20 > > > > On Fri, 20 Apr 2018 11:44:32 +0200, > > > > Kai-Heng Feng wrote: > > > > > Now it's a typical discrete-only system. HDMI audio comes from AM= D audio > > > > > controller, others from Intel audio controller. > > > > >=20 > > > > > When SG is enabled, the unused AMD audio contoller still exposes = its > > > > > sysfs, so userspace still opens the control file and stream. If > > > > > userspace tries to output sound through the stream, it hangs the = system. > > > >=20 > > > > Hm, could you give more information about how it hangs? > > >=20 > > > Well, I should say "it hangs the userspace process" instead. > > >=20 > > > $ speaker-test -t wav -c 2 -D hw:CARD=3DHDMI,DEV=3D3 > > > ...and it just stopped. Can't Ctrl+C to break it. > >=20 > > So userspace process cannot be killed at all? Then it is different bug > > in kernel and disabling pci device is just a workaround. Not a real fix. > >=20 > > I would propose to find out what happen and why it cannot be killed > > (probably it stuck somewhere in kernel) and fix it properly. >=20 > That's because the audio device got runtime suspended by the graphics. >=20 > In this case, if we really want to use the the discrete audio, then we al= so > need to wake up the graphics. > The discrete audio is totally useless when SG is enabled, so my approach = is > just to disable it. I'm not saying that disabling PCI should not be done. I'm saying that if userspace process which opened that audio device cannot be killed, then you found different kernel bug and that should be fixed. > Kai-Heng >=20 > >=20 > > > > > @@ -1627,6 +1629,42 @@ static void check_msi(struct azx *chip) > > > > > } > > > > > } > > > > >=20 > > > > > +#if IS_ENABLED(CONFIG_DELL_LAPTOP) > > > >=20 > > > > This should be IS_REACHABLE(), as both dell-laptop and HD-audio are > > > > tristate. > > >=20 > > > Thanks, will update in next version. > > >=20 > > > > > +static bool check_dell_switchable_gfx(struct pci_dev *pdev) > > > >=20 > > > > I'd remove "_dell" word here. Such a check would be likely needed = for > > > > other vendors, and it's quite possible that the function will be > > > > extended to cover a wider DMI table. > > >=20 > > > Makes sense. Will also update this one. > > >=20 > > > Kai-Heng > > >=20 > > > > thanks, > > > >=20 > > > > Takashi > >=20 > > --=20 > > Pali Roh=C3=A1r > > pali.rohar@gmail.com --=20 Pali Roh=C3=A1r pali.rohar@gmail.com