Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5577737ybl; Tue, 27 Aug 2019 06:49:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLF93pdEemd/qQRcoRev78UFxdZMZEbo0C7uCalNHolWoI18mbdXVsFPTY5fbQiLdDFK3w X-Received: by 2002:a17:902:8301:: with SMTP id bd1mr3499989plb.120.1566913780700; Tue, 27 Aug 2019 06:49:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566913780; cv=none; d=google.com; s=arc-20160816; b=SIbu4QC5VT+/2+AgC9+z0dC1+kJ3CTriEYqlZwM3BxVzAJcJ/1nSVGBWjfkepS6YOb CWhK1v+1C19m5DskTxZeSWplPJShtRxjebcb36SrqjJA9k6c9MYvTxygOxzx3iS5Cmex Sjpwn3HJD/ZD5x4Y9/fp9N38lGuH3fzr60PstZLrDHHNCJK1/cqYPGL12sl4JrJyuKSl jahiLapK7AatgtRFcIkp435d5wuEQgm6AncoHEvvj8xkNVvYN5SxIuUvDOScte7MWtDt 899R9zbELRo0Vhk98mc+wtKeYWYpfS/7vVlgXi9CeU66ICsJPCh6eEc4CWSEqKMJAr5H 4hSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=i8eLYTems0OqKrcd24jDGsrMWuXmJsYbYI2c0BB3qQY=; b=PnRQwZOTnDDmCZR22wEbgNJeZyKC02b3e1LQPTVzOKCLFcMZGVxY7BDFweIjoPyIdm hXNtZtWqS4fUqF5QzVj5GexLGmsOKQb3U/GCt0Qv2F7cIgjQ738vK96QyLRCV5VKHPkz zSz2vXnJSY8I+o9YWQHFs8RW2muetFIvEUB+l2scODx3gCaAkLx/G8C00siSWYnzf6dx klUratDDYcdUJ8jScbgAYwxa7+EGtMvdOU7fTGPYZ5RhpWfjVjhLrAjgKy8YZizuHfTY FqoNj0wZ9rRaOpHCMD8gOGhsIqGHxBwLrMvF5NQfw08dTXfAngyPGtJycpjt2UAe+mWC K7dw== 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 29si11845712pgk.306.2019.08.27.06.49.25; Tue, 27 Aug 2019 06:49:40 -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 S1730055AbfH0NsJ (ORCPT + 99 others); Tue, 27 Aug 2019 09:48:09 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:37100 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728324AbfH0NsH (ORCPT ); Tue, 27 Aug 2019 09:48:07 -0400 Received: from 61-220-137-37.hinet-ip.hinet.net ([61.220.137.37] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1i2bpN-0005tS-6V; Tue, 27 Aug 2019 13:48:05 +0000 From: Kai-Heng Feng To: bhelgaas@google.com, tiwai@suse.com Cc: linux-pci@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Kai-Heng Feng Subject: [PATCH 2/2] ALSA: hda: Allow HDA to be runtime suspended when dGPU is not bound Date: Tue, 27 Aug 2019 21:47:56 +0800 Message-Id: <20190827134756.10807-2-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190827134756.10807-1-kai.heng.feng@canonical.com> References: <20190827134756.10807-1-kai.heng.feng@canonical.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's a common practice to let dGPU unbound and use PCI port PM to disable its power through _PR3. When the dGPU comes with an HDA function, the HDA won't be suspended if the dGPU is unbound, so the dGPU power can't be disabled. Commit 37a3a98ef601 ("ALSA: hda - Enable runtime PM only for discrete GPU") only allows HDA to be runtime-suspended once GPU is bound, to keep APU's HDA working. However, HDA on dGPU isn't that useful if dGPU is unbound. So let relax the runtime suspend requirement for dGPU's HDA function, to save lots of power. BugLink: https://bugs.launchpad.net/bugs/1840835 Signed-off-by: Kai-Heng Feng --- sound/pci/hda/hda_intel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 99fc0917339b..d4ee070e1a29 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1285,7 +1285,8 @@ static void init_vga_switcheroo(struct azx *chip) dev_info(chip->card->dev, "Handle vga_switcheroo audio client\n"); hda->use_vga_switcheroo = 1; - hda->need_eld_notify_link = 1; /* cleared in gpu_bound op */ + /* cleared in gpu_bound op */ + hda->need_eld_notify_link = !pci_pr3_present(p); chip->driver_caps |= AZX_DCAPS_PM_RUNTIME; pci_dev_put(p); } -- 2.17.1