aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-01-20 20:17:42 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-01-23 16:13:54 -0500
commitbac2a909a096c9110525c18cbb8ce73c660d5f71 (patch)
tree59bd2a6efea9c9cb4cca404f35ae94c67f0dd988 /drivers/pci/pci.h
parentec6f34e5b552fb0a52e6aae1a5afbbb1605cc6cc (diff)
PCI / PM: Avoid resuming PCI devices during system suspend
Commit f25c0ae2b4c4 (ACPI / PM: Avoid resuming devices in ACPI PM domain during system suspend) modified the ACPI PM domain's system suspend callbacks to allow devices attached to it to be left in the runtime-suspended state during system suspend so as to optimize the suspend process. This was based on the general mechanism introduced by commit aae4518b3124 (PM / sleep: Mechanism to avoid resuming runtime-suspended devices unnecessarily). Extend that approach to PCI devices by modifying the PCI bus type's ->prepare callback to return 1 for devices that are runtime-suspended when it is being executed and that are in a suitable power state and need not be resumed going forward. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/pci.h')
-rw-r--r--drivers/pci/pci.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 8aff29a804ff..febb3db9f742 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -50,6 +50,10 @@ int pci_probe_reset_function(struct pci_dev *dev);
50 * for given device (the device's wake-up capability has to be 50 * for given device (the device's wake-up capability has to be
51 * enabled by @sleep_wake for this feature to work) 51 * enabled by @sleep_wake for this feature to work)
52 * 52 *
53 * @need_resume: returns 'true' if the given device (which is currently
54 * suspended) needs to be resumed to be configured for system
55 * wakeup.
56 *
53 * If given platform is generally capable of power managing PCI devices, all of 57 * If given platform is generally capable of power managing PCI devices, all of
54 * these callbacks are mandatory. 58 * these callbacks are mandatory.
55 */ 59 */
@@ -59,6 +63,7 @@ struct pci_platform_pm_ops {
59 pci_power_t (*choose_state)(struct pci_dev *dev); 63 pci_power_t (*choose_state)(struct pci_dev *dev);
60 int (*sleep_wake)(struct pci_dev *dev, bool enable); 64 int (*sleep_wake)(struct pci_dev *dev, bool enable);
61 int (*run_wake)(struct pci_dev *dev, bool enable); 65 int (*run_wake)(struct pci_dev *dev, bool enable);
66 bool (*need_resume)(struct pci_dev *dev);
62}; 67};
63 68
64int pci_set_platform_pm(struct pci_platform_pm_ops *ops); 69int pci_set_platform_pm(struct pci_platform_pm_ops *ops);
@@ -67,6 +72,7 @@ void pci_power_up(struct pci_dev *dev);
67void pci_disable_enabled_device(struct pci_dev *dev); 72void pci_disable_enabled_device(struct pci_dev *dev);
68int pci_finish_runtime_suspend(struct pci_dev *dev); 73int pci_finish_runtime_suspend(struct pci_dev *dev);
69int __pci_pme_wakeup(struct pci_dev *dev, void *ign); 74int __pci_pme_wakeup(struct pci_dev *dev, void *ign);
75bool pci_dev_keep_suspended(struct pci_dev *dev);
70void pci_config_pm_runtime_get(struct pci_dev *dev); 76void pci_config_pm_runtime_get(struct pci_dev *dev);
71void pci_config_pm_runtime_put(struct pci_dev *dev); 77void pci_config_pm_runtime_put(struct pci_dev *dev);
72void pci_pm_init(struct pci_dev *dev); 78void pci_pm_init(struct pci_dev *dev);