public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI / ACPI / PM: Avoid resuming devices that don't signal PME
@ 2011-11-06 21:21 Rafael J. Wysocki
  2011-11-11 17:49 ` Jesse Barnes
  0 siblings, 1 reply; 2+ messages in thread
From: Rafael J. Wysocki @ 2011-11-06 21:21 UTC (permalink / raw)
  To: Jesse Barnes
  Cc: LKML, ACPI Devel Mailing List, Linux PM list, Matthew Garrett

From: Rafael J. Wysocki <rjw@sisk.pl>

Modify pci_acpi_wake_dev() to avoid resuming PME-capable devices
whose PME Status bits are not set, which may happen currently if
several devices are associated with the same wakeup GPE and all
of them are notified whenever at least one of them signals PME.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 drivers/pci/pci-acpi.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Index: linux/drivers/pci/pci-acpi.c
===================================================================
--- linux.orig/drivers/pci/pci-acpi.c
+++ linux/drivers/pci/pci-acpi.c
@@ -45,16 +45,20 @@ static void pci_acpi_wake_dev(acpi_handl
 {
 	struct pci_dev *pci_dev = context;
 
-	if (event == ACPI_NOTIFY_DEVICE_WAKE && pci_dev) {
+	if (event != ACPI_NOTIFY_DEVICE_WAKE || !pci_dev)
+		return;
+
+	if (!pci_dev->pm_cap || !pci_dev->pme_support
+	     || pci_check_pme_status(pci_dev)) {
 		if (pci_dev->pme_poll)
 			pci_dev->pme_poll = false;
 
 		pci_wakeup_event(pci_dev);
-		pci_check_pme_status(pci_dev);
 		pm_runtime_resume(&pci_dev->dev);
-		if (pci_dev->subordinate)
-			pci_pme_wakeup_bus(pci_dev->subordinate);
 	}
+
+	if (pci_dev->subordinate)
+		pci_pme_wakeup_bus(pci_dev->subordinate);
 }
 
 /**

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] PCI / ACPI / PM: Avoid resuming devices that don't signal PME
  2011-11-06 21:21 [PATCH] PCI / ACPI / PM: Avoid resuming devices that don't signal PME Rafael J. Wysocki
@ 2011-11-11 17:49 ` Jesse Barnes
  0 siblings, 0 replies; 2+ messages in thread
From: Jesse Barnes @ 2011-11-11 17:49 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: LKML, ACPI Devel Mailing List, Linux PM list, Matthew Garrett

[-- Attachment #1: Type: text/plain, Size: 589 bytes --]

On Sun, 6 Nov 2011 22:21:46 +0100
"Rafael J. Wysocki" <rjw@sisk.pl> wrote:

> From: Rafael J. Wysocki <rjw@sisk.pl>
> 
> Modify pci_acpi_wake_dev() to avoid resuming PME-capable devices
> whose PME Status bits are not set, which may happen currently if
> several devices are associated with the same wakeup GPE and all
> of them are notified whenever at least one of them signals PME.
> 
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> ---
>  drivers/pci/pci-acpi.c |   12 ++++++++----

Applied to -next, thanks.

-- 
Jesse Barnes, Intel Open Source Technology Center

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-11 17:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-06 21:21 [PATCH] PCI / ACPI / PM: Avoid resuming devices that don't signal PME Rafael J. Wysocki
2011-11-11 17:49 ` Jesse Barnes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox