archive mirror
 help / color / mirror / Atom feed
From: Mika Westerberg <>
To: Bjorn Helgaas <>,
	"Rafael J. Wysocki" <>
Cc: Lukas Wunner <>, David Airlie <>,
	Daniel Vetter <>,
	Utkarsh Patel <>,
	Maarten Lankhorst <>,
	Maxime Ripard <>,
	Thomas Zimmermann <>,
	Mika Westerberg <>,
Subject: [PATCH v2 1/2] PCI/PM: Do not generate wakeup event when runtime resuming bus
Date: Wed, 25 Nov 2020 12:07:32 +0300	[thread overview]
Message-ID: <> (raw)

When a PCI bridge is runtime resumed from D3cold the underlying bus is
walked and the attached devices are runtime resumed as well. However, in
addition to that we also generate a wakeup event for these devices even
though this actually is not a real wakeup event coming from the

Normally this does not cause problems but when combined with
/sys/power/wakeup_count like using the steps below:

  # count=$(cat /sys/power/wakeup_count)
  # echo $count > /sys/power/wakeup_count
  # echo mem > /sys/power/state

The system suspend cycle might fail at this point if a PCI bridge that
was runtime suspended (D3cold) was runtime resumed for any reason. The
runtime resume calls pci_wakeup_bus() and that generates wakeup event
increasing wakeup_count.

Since this is not a real wakeup event we can prevent the above from
happening by removing the call to pci_wakeup_event() in

Reported-by: Utkarsh Patel <>
Signed-off-by: Mika Westerberg <>
Reviewed-by: Rafael J. Wysocki <>
Previous version can be found here:

Changes from the previous version:

  - Split the patch in two. The second patch only does the rename.
  - Tried to improve the commit message a bit
  - Added Rafael's reviewed-by tag

 drivers/pci/pci.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index e578d34095e9..6f7b33998fbe 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1181,7 +1181,6 @@ EXPORT_SYMBOL_GPL(pci_platform_power_transition);
 static int pci_wakeup(struct pci_dev *pci_dev, void *ign)
-	pci_wakeup_event(pci_dev);
 	return 0;

             reply	other threads:[~2020-11-25  9:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25  9:07 Mika Westerberg [this message]
2020-11-25  9:07 ` [PATCH v2 2/2] PCI: Rename pci_wakeup_bus() to pci_resume_bus() Mika Westerberg
2020-12-04 23:18 ` [PATCH v2 1/2] PCI/PM: Do not generate wakeup event when runtime resuming bus Bjorn Helgaas

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 \ \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH v2 1/2] PCI/PM: Do not generate wakeup event when runtime resuming bus' \

* 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).