Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp46766ybl; Tue, 27 Aug 2019 15:32:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTYXLSbIDK5xbSZ76a86mTFga7HImDzkWuyfdF4AKZ9OxkqyBzRFDIhFtML03VvU5uA4NC X-Received: by 2002:a63:2264:: with SMTP id t36mr648867pgm.87.1566945158126; Tue, 27 Aug 2019 15:32:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566945158; cv=none; d=google.com; s=arc-20160816; b=k7E0pGdW3yUJoYOrxYT7sNLPnifyxspHZ+ZJWD8XTEQ09YpHgLxhuIFfERobCfrppb mJ1WeVA4bgaVXiBCnVflVqu/KScR/1c+0q1hfbCP+LzevMqvxF+O2QQ1xOJgcIgcLxpK UzU6MKmwWLrkJHvhFFdtr5YYafMEwHoILZRL+r48zruOFtswLc0k1QXnPuP7RA2uI/JL sojQ29p3TsKONwpz1tOJsbpwXx71icHvGiAlhGte8RGFemuSjP7nqMz+qCzalK0T5PNv 8YZC7PzOoCPazI4B5dyCHS6SL4cSAO6jkQpSVPp6YiWpxcYF6FNwN4wILV52PSaAd9NQ tlww== 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:dkim-signature; bh=x1oQPolxMmheaNlKlDGOZAG2tLARbc2/2uyBvvWKX18=; b=hIxz8NwX3g740nAPMaUEx1ye/Ai4J2slllWYOMI9GBEud7A/Nu3lu4M81VCZQ9edNm TBH67l6JJcSwv/4WMHk0geKmINeO0g1b0XW3mGvNYU+GXriY2zs6M/P4ejLiWmxXJOrr AcC5yOXNeNOk3sFJglXarVacvcnMT7taLkRv+6ELgEItwqGeB/0/P2YnMDebdrtBXZdg 38cfPZINCuZwKk4V4aU19JpKYvylUzjok89Fem9g5E+amj9d8NfG0ez0Q8Qci/iu7RJm S84JlQ+sdFcuSEAEGsQOdQMe3KgLZq9SiU13AYyX4ebcDVwUbAT0n3GujAJHcFyDhDeR ud/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Migu+if6; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5si551573pgs.414.2019.08.27.15.32.19; Tue, 27 Aug 2019 15:32:38 -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=@kernel.org header.s=default header.b=Migu+if6; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726092AbfH0Wb2 (ORCPT + 99 others); Tue, 27 Aug 2019 18:31:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:59592 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725989AbfH0Wb2 (ORCPT ); Tue, 27 Aug 2019 18:31:28 -0400 Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C760F20856; Tue, 27 Aug 2019 22:31:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566945087; bh=z3lcNGmdvmqEXqVEX9g8KC0XV/I/hJtGSWKjLohh+3k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Migu+if62iFs5FV4qKaJ8LZCNRwNok5KflTlEHuwAOZ9iaxShqp/IWMO+EImucQVc HD2pxOhjBOWs6s1j223Xn/n0+4yOH4Bg3uGkzkILe9q+GbkxbFe6WtEy54XmNqcZSV mFh7XfmdHOserrq/VomMnyq6vQFKnxrs0/zG1cPs= Date: Tue, 27 Aug 2019 17:31:25 -0500 From: Bjorn Helgaas To: Kai-Heng Feng Cc: tiwai@suse.com, linux-pci@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] ALSA: hda: Allow HDA to be runtime suspended when dGPU is not bound Message-ID: <20190827223125.GB9987@google.com> References: <20190827134756.10807-1-kai.heng.feng@canonical.com> <20190827134756.10807-2-kai.heng.feng@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190827134756.10807-2-kai.heng.feng@canonical.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 27, 2019 at 09:47:56PM +0800, Kai-Heng Feng wrote: > 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. Just a terminology question: I thought "using PCI port PM" meant using the PCI Power Management Capability in config space to directly change the device's power state, e.g., in pci_raw_set_power_state(). And I thought using _PS3, _PR3, etc would be part of "platform power management"? And AFAICT, _PR3 merely returns a list of power resources; it doesn't disable power itself. > 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 >