LKML Archive on
help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <>
To: Linux PCI <>,
	Mika Westerberg <>
Cc: Linux ACPI <>,
	Linux PM <>,
	LKML <>,
	Bjorn Helgaas <>,
	Kai-Heng Feng <>,
	Utkarsh H Patel <>,
	Koba Ko <>
Subject: [PATCH v1 2/2] PCI: PM: Enable PME if it can be signaled from D3cold
Date: Thu, 29 Jul 2021 16:49:10 +0200	[thread overview]
Message-ID: <1791325.tdWV9SEqCh@kreacher> (raw)
In-Reply-To: <4668274.31r3eYUQgx@kreacher>

From: Rafael J. Wysocki <>

PME signaling is only enabled by __pci_enable_wake() if the target
device can signal PME from the given target power state (to avoid
pointless reconfiguration of the device), but if the hierarchy above
the device goes into D3cold, the device itself will end up in D3cold
too, so if it can signal PME from D3cold, it should be enabled to
do so in __pci_enable_wake().

[Note that if the device does not end up in D3cold and it cannot
 signal PME from the original target power state, it will not signal
 PME, so in that case the behavior does not change.]

Fixes: 5bcc2fb4e815 ("PCI PM: Simplify PCI wake-up code")
Reported-by: Mika Westerberg <>
Reported-by: Utkarsh H Patel <>
Reported-by: Koba Ko <>
Signed-off-by: Rafael J. Wysocki <>
 drivers/pci/pci.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Index: linux-pm/drivers/pci/pci.c
--- linux-pm.orig/drivers/pci/pci.c
+++ linux-pm/drivers/pci/pci.c
@@ -2491,7 +2491,14 @@ static int __pci_enable_wake(struct pci_
 	if (enable) {
 		int error;
-		if (pci_pme_capable(dev, state))
+		/*
+		 * Enable PME signaling if the device can signal PME from
+		 * D3cold regardless of whether or not it can signal PME from
+		 * the current target state, because that will allow it to
+		 * signal PME when the hierarchy above it goes into D3cold and
+		 * the device itself ends up in D3cold as a result of that.
+		 */
+		if (pci_pme_capable(dev, state) || pci_pme_capable(dev, PCI_D3cold))
 			pci_pme_active(dev, true);
 			ret = 1;

  parent reply	other threads:[~2021-07-29 14:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29 14:46 [PATCH v1 0/2] PCI: PM: Fix handling of device that can only signal PME " Rafael J. Wysocki
2021-07-29 14:48 ` [PATCH v1 1/2] PCI: PM: Add special case handling for PCIe device wakeup Rafael J. Wysocki
2021-07-29 15:09   ` Rafael J. Wysocki
2021-07-29 15:54   ` [PATCH v1.1 1/2] PCI: PM: Avoid forcing PCI_D0 for wakeup reasons inconsistently Rafael J. Wysocki
2021-07-30 10:26     ` Mika Westerberg
2021-07-29 14:49 ` Rafael J. Wysocki [this message]
2021-07-30 10:28   ` [PATCH v1 2/2] PCI: PM: Enable PME if it can be signaled from D3cold Mika Westerberg
2021-07-30 12:13     ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1791325.tdWV9SEqCh@kreacher \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH v1 2/2] PCI: PM: Enable PME if it can be signaled from D3cold' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).