PCI PM: Fix pci_prepare_to_sleep

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jesse,

The recently introduced pci_prepare_to_sleep() needs the following fix,
because there are systems which are not power manageable by ACPI (ie. ACPI
doesn't provide methods to put the device into low power states and back), but
require ACPI hooks to be executed for wake-up to work.

Please apply.

Thanks,
Rafael

---
From: Rafael J. Wysocki <rjw@xxxxxxx>

Fix pci_prepare_to_sleep() to work on systems that are not power
manageable by ACPI (ie. ACPI doesn't provide methods to put the
device into low power states and back into the full power state), but
require ACPI hooks to be executed for wake-up to work.

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

Index: linux-next/drivers/pci/pci.c
===================================================================
--- linux-next.orig/drivers/pci/pci.c
+++ linux-next/drivers/pci/pci.c
@@ -1153,7 +1153,6 @@ int pci_prepare_to_sleep(struct pci_dev 
 				break;
 		default:
 			target_state = state;
-			pci_enable_wake(dev, target_state, true);
 		}
 	} else if (device_may_wakeup(&dev->dev)) {
 		/*
@@ -1168,10 +1167,11 @@ int pci_prepare_to_sleep(struct pci_dev 
 			while (target_state
 			      && !(dev->pme_support & (1 << target_state)))
 				target_state--;
-			pci_pme_active(dev, true);
 		}
 	}
 
+	pci_enable_wake(dev, target_state, true);
+
 	error = pci_set_power_state(dev, target_state);
 
 	if (error)
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm

[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux