aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-04 14:14:36 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-04 14:14:36 -0400
commitf46e9913faeebcb6bd29edf795f12b60acbff171 (patch)
tree1ed8871d0ebd638094d27317de1d8a53712ae15a /drivers/pci/pci.c
parent8d91530c5fd7f0b1e8c4ddfea2905e55a178569b (diff)
parent8d4b9d1bfef117862a2889dec4dac227068544c9 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6: PM / Runtime: Add runtime PM statistics (v3) PM / Runtime: Make runtime_status attribute not debug-only (v. 2) PM: Do not use dynamically allocated objects in pm_wakeup_event() PM / Suspend: Fix ordering of calls in suspend error paths PM / Hibernate: Fix snapshot error code path PM / Hibernate: Fix hibernation_platform_enter() pm_qos: Get rid of the allocation in pm_qos_add_request() pm_qos: Reimplement using plists plist: Add plist_last PM: Make it possible to avoid races between wakeup and system sleep PNPACPI: Add support for remote wakeup PM: describe kernel policy regarding wakeup defaults (v. 2) PM / Hibernate: Fix typos in comments in kernel/power/swap.c
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 740fb4ea9669..130ed1daf0f8 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1275,6 +1275,22 @@ bool pci_check_pme_status(struct pci_dev *dev)
1275 return ret; 1275 return ret;
1276} 1276}
1277 1277
1278/*
1279 * Time to wait before the system can be put into a sleep state after reporting
1280 * a wakeup event signaled by a PCI device.
1281 */
1282#define PCI_WAKEUP_COOLDOWN 100
1283
1284/**
1285 * pci_wakeup_event - Report a wakeup event related to a given PCI device.
1286 * @dev: Device to report the wakeup event for.
1287 */
1288void pci_wakeup_event(struct pci_dev *dev)
1289{
1290 if (device_may_wakeup(&dev->dev))
1291 pm_wakeup_event(&dev->dev, PCI_WAKEUP_COOLDOWN);
1292}
1293
1278/** 1294/**
1279 * pci_pme_wakeup - Wake up a PCI device if its PME Status bit is set. 1295 * pci_pme_wakeup - Wake up a PCI device if its PME Status bit is set.
1280 * @dev: Device to handle. 1296 * @dev: Device to handle.
@@ -1285,8 +1301,10 @@ bool pci_check_pme_status(struct pci_dev *dev)
1285 */ 1301 */
1286static int pci_pme_wakeup(struct pci_dev *dev, void *ign) 1302static int pci_pme_wakeup(struct pci_dev *dev, void *ign)
1287{ 1303{
1288 if (pci_check_pme_status(dev)) 1304 if (pci_check_pme_status(dev)) {
1289 pm_request_resume(&dev->dev); 1305 pm_request_resume(&dev->dev);
1306 pci_wakeup_event(dev);
1307 }
1290 return 0; 1308 return 0;
1291} 1309}
1292 1310