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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 8B816C43216 for ; Fri, 30 Jul 2021 10:26:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 746A960F46 for ; Fri, 30 Jul 2021 10:26:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238455AbhG3K0o (ORCPT ); Fri, 30 Jul 2021 06:26:44 -0400 Received: from mga11.intel.com ([192.55.52.93]:53264 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238274AbhG3K0n (ORCPT ); Fri, 30 Jul 2021 06:26:43 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10060"; a="209959346" X-IronPort-AV: E=Sophos;i="5.84,281,1620716400"; d="scan'208";a="209959346" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2021 03:26:38 -0700 X-IronPort-AV: E=Sophos;i="5.84,281,1620716400"; d="scan'208";a="418432773" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.163]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2021 03:26:34 -0700 Received: by lahna (sSMTP sendmail emulation); Fri, 30 Jul 2021 13:26:31 +0300 Date: Fri, 30 Jul 2021 13:26:31 +0300 From: Mika Westerberg To: "Rafael J. Wysocki" Cc: Linux PCI , Linux ACPI , Linux PM , LKML , Bjorn Helgaas , Kai-Heng Feng , Utkarsh H Patel , Koba Ko Subject: Re: [PATCH v1.1 1/2] PCI: PM: Avoid forcing PCI_D0 for wakeup reasons inconsistently Message-ID: References: <4668274.31r3eYUQgx@kreacher> <2207145.ElGaqSPkdT@kreacher> <2593738.mvXUDI8C0e@kreacher> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2593738.mvXUDI8C0e@kreacher> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 29, 2021 at 05:54:28PM +0200, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > It is inconsistent to return PCI_D0 from pci_target_state() instead > of the original target state if 'wakeup' is true and the device > cannot signal PME from D0. > > This only happens when the device cannot signal PME from the original > target state and any shallower power states (including D0) and that > case is effectively equivalent to the one in which PME singaling is > not supported at all. Since the original target state is returned in > the latter case, make the function do that in the former one too. > > Link: https://lore.kernel.org/linux-pm/3149540.aeNJFYEL58@kreacher/ > Fixes: 666ff6f83e1d ("PCI/PM: Avoid using device_may_wakeup() for runtime PM") > Reported-by: Mika Westerberg Reviewed-by: Mika Westerberg Tested-by: Mika Westerberg