From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0AA67C3A5A3 for ; Tue, 27 Aug 2019 22:13:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D0EF62077B for ; Tue, 27 Aug 2019 22:13:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566944005; bh=LZPQogWInSb9gqAI/aacGbig10OJaeQDStsJ1k9m4k8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=GdispYuNzgOhW/WXcIIsWsBXvJ9zoGOOy1MimTx4aM3l04Y8kI+PB2sciPUKjFcO/ 7JR4BgEAfMlL6/zb8ndGrqk2Az4tTpNkdlNgtrS/r6I5Yd24aGuTO64yczPzS4qdi/ CUewSCqokdoAc6TlNx9563es2ru2BIZ7i3J8GA8I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725992AbfH0WNZ (ORCPT ); Tue, 27 Aug 2019 18:13:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:54806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725989AbfH0WNZ (ORCPT ); Tue, 27 Aug 2019 18:13:25 -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 D036120679; Tue, 27 Aug 2019 22:13:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566944004; bh=LZPQogWInSb9gqAI/aacGbig10OJaeQDStsJ1k9m4k8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qY4Vfyb0VjYNejMGwIgHw25hJrjYFb+65rOtdKARqBjG31pqtDOU7WfU9tXxDjYjo jPnwwr5yMWnzW5y6m1+X2akbYC87QcyyGv+tGBnMRnxtfq+6uD1FgObO18DFy7kPw/ zRECNK84asDwgGcK+jly/EWPp28g+asVgZxD8N1s= Date: Tue, 27 Aug 2019 17:13:21 -0500 From: Bjorn Helgaas To: Kai-Heng Feng Cc: Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Peter Wu , Mika Westerberg , Dave Airlie Subject: Re: [PATCH 1/2] PCI: Add a helper to check Power Resource Requirements _PR3 existence Message-ID: <20190827221321.GA9987@google.com> References: <20190827134756.10807-1-kai.heng.feng@canonical.com> <0379E973-651A-442C-AF74-51702388F55D@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0379E973-651A-442C-AF74-51702388F55D@canonical.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org [+cc Peter, Mika, Dave] https://lore.kernel.org/r/20190827134756.10807-1-kai.heng.feng@canonical.com On Wed, Aug 28, 2019 at 12:58:28AM +0800, Kai-Heng Feng wrote: > at 23:25, Takashi Iwai wrote: > > On Tue, 27 Aug 2019 15:47:55 +0200, > > Kai-Heng Feng wrote: > > > A driver may want to know the existence of _PR3, to choose different > > > runtime suspend behavior. A user will be add in next patch. > > > > > > This is mostly the same as nouveau_pr3_present(). > > > > Then it'd be nice to clean up the nouveau part, too? > > nouveau_pr3_present() may call pci_d3cold_disable(), and my intention is to > only check the presence of _PR3 (i.e. a dGPU) without touching anything. It looks like Peter added that code with 279cf3f23870 ("drm/nouveau/acpi: use DSM if bridge does not support D3cold"). I don't understand the larger picture, but it is somewhat surprising that nouveau_pr3_present() *looks* like a simple predicate with no side-effects, but in fact it disables the use of D3cold in some cases. If the disable were moved to the caller, Kai-Heng's new interface could be used both places.