diff options
| author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-07-15 17:59:25 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-07-15 17:59:25 -0400 |
| commit | 7ae033cc0dfce68d8e0c83aca60837cf2bf0d2e6 (patch) | |
| tree | 91bb3b8ae2790c7fef06b1832a7df61ae496a77a | |
| parent | ba1389d74f34c0c6e95cc135a332cd29c29d9c20 (diff) | |
| parent | c8c9fda5069456eb9e0e403c19764b2e257802e1 (diff) | |
Merge branch 'pm-runtime' into for-linus
* pm-runtime:
OMAP: PM: disable idle on suspend for GPIO and UART
OMAP: PM: omap_device: add API to disable idle on suspend
OMAP: PM: omap_device: add system PM methods for PM domain handling
OMAP: PM: omap_device: conditionally use PM domain runtime helpers
PM / Runtime: Add new helper function: pm_runtime_status_suspended()
PM / Runtime: Consistent utilization of deferred_resume
PM / Runtime: Prevent runtime_resume from racing with probe
PM / Runtime: Replace "run-time" with "runtime" in documentation
PM / Runtime: Improve documentation of enable, disable and barrier
PM: Limit race conditions between runtime PM and system sleep (v2)
PCI / PM: Detect early wakeup in pci_pm_prepare()
PM / Runtime: Return special error code if runtime PM is disabled
PM / Runtime: Update documentation of interactions with system sleep
| -rw-r--r-- | Documentation/power/devices.txt | 6 | ||||
| -rw-r--r-- | Documentation/power/runtime_pm.txt | 197 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/gpio.c | 2 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/serial.c | 1 | ||||
| -rw-r--r-- | arch/arm/plat-omap/include/plat/omap_device.h | 9 | ||||
| -rw-r--r-- | arch/arm/plat-omap/omap_device.c | 49 | ||||
| -rw-r--r-- | drivers/base/power/main.c | 35 | ||||
| -rw-r--r-- | drivers/base/power/runtime.c | 77 | ||||
| -rw-r--r-- | drivers/base/power/sysfs.c | 6 | ||||
| -rw-r--r-- | drivers/pci/pci-driver.c | 18 | ||||
| -rw-r--r-- | drivers/scsi/scsi_pm.c | 8 | ||||
| -rw-r--r-- | include/linux/pm_runtime.h | 6 |
12 files changed, 277 insertions, 137 deletions
diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt index 85c6f980b642..3384d5996be2 100644 --- a/Documentation/power/devices.txt +++ b/Documentation/power/devices.txt | |||
| @@ -604,7 +604,7 @@ state temporarily, for example so that its system wakeup capability can be | |||
| 604 | disabled. This all depends on the hardware and the design of the subsystem and | 604 | disabled. This all depends on the hardware and the design of the subsystem and |
| 605 | device driver in question. | 605 | device driver in question. |
| 606 | 606 | ||
| 607 | During system-wide resume from a sleep state it's best to put devices into the | 607 | During system-wide resume from a sleep state it's easiest to put devices into |
| 608 | full-power state, as explained in Documentation/power/runtime_pm.txt. Refer to | 608 | the full-power state, as explained in Documentation/power/runtime_pm.txt. Refer |
| 609 | that document for more information regarding this particular issue as well as | 609 | to that document for more information regarding this particular issue as well as |
| 610 | for information on the device runtime power management framework in general. | 610 | for information on the device runtime power management framework in general. |
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt index 4b011b171be4..14dd3c6ad97e 100644 --- a/Documentation/power/runtime_pm.txt +++ b/Documentation/power/runtime_pm.txt | |||
| @@ -1,39 +1,39 @@ | |||
| 1 | Run-time Power Management Framework for I/O Devices | 1 | Runtime Power Management Framework for I/O Devices |
| 2 | 2 | ||
| 3 | (C) 2009-2011 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc. | 3 | (C) 2009-2011 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc. |
| 4 | (C) 2010 Alan Stern <stern@rowland.harvard.edu> | 4 | (C) 2010 Alan Stern <stern@rowland.harvard.edu> |
| 5 | 5 | ||
| 6 | 1. Introduction | 6 | 1. Introduction |
| 7 | 7 | ||
| 8 | Support for run-time power management (run-time PM) of I/O devices is provided | 8 | Support for runtime power management (runtime PM) of I/O devices is provided |
| 9 | at the power management core (PM core) level by means of: | 9 | at the power management core (PM core) level by means of: |
| 10 | 10 | ||
| 11 | * The power management workqueue pm_wq in which bus types and device drivers can | 11 | * The power management workqueue pm_wq in which bus types and device drivers can |
| 12 | put their PM-related work items. It is strongly recommended that pm_wq be | 12 | put their PM-related work items. It is strongly recommended that pm_wq be |
| 13 | used for queuing all work items related to run-time PM, because this allows | 13 | used for queuing all work items related to runtime PM, because this allows |
| 14 | them to be synchronized with system-wide power transitions (suspend to RAM, | 14 | them to be synchronized with system-wide power transitions (suspend to RAM, |
| 15 | hibernation and resume from system sleep states). pm_wq is declared in | 15 | hibernation and resume from system sleep states). pm_wq is declared in |
| 16 | include/linux/pm_runtime.h and defined in kernel/power/main.c. | 16 | include/linux/pm_runtime.h and defined in kernel/power/main.c. |
| 17 | 17 | ||
| 18 | * A number of run-time PM fields in the 'power' member of 'struct device' (which | 18 | * A number of runtime PM fields in the 'power' member of 'struct device' (which |
| 19 | is of the type 'struct dev_pm_info', defined in include/linux/pm.h) that can | 19 | is of the type 'struct dev_pm_info', defined in include/linux/pm.h) that can |
| 20 | be used for synchronizing run-time PM operations with one another. | 20 | be used for synchronizing runtime PM operations with one another. |
| 21 | 21 | ||
| 22 | * Three device run-time PM callbacks in 'struct dev_pm_ops' (defined in | 22 | * Three device runtime PM callbacks in 'struct dev_pm_ops' (defined in |
| 23 | include/linux/pm.h). | 23 | include/linux/pm.h). |
| 24 | 24 | ||
| 25 | * A set of helper functions defined in drivers/base/power/runtime.c that can be | 25 | * A set of helper functions defined in drivers/base/power/runtime.c that can be |
| 26 | used for carrying out run-time PM operations in such a way that the | 26 | used for carrying out runtime PM operations in such a way that the |
| 27 | synchronization between them is taken care of by the PM core. Bus types and | 27 | synchronization between them is taken care of by the PM core. Bus types and |
| 28 | device drivers are encouraged to use these functions. | 28 | device drivers are encouraged to use these functions. |
| 29 | 29 | ||
| 30 | The run-time PM callbacks present in 'struct dev_pm_ops', the device run-time PM | 30 | The runtime PM callbacks present in 'struct dev_pm_ops', the device runtime PM |
| 31 | fields of 'struct dev_pm_info' and the core helper functions provided for | 31 | fields of 'struct dev_pm_info' and the core helper functions provided for |
| 32 | run-time PM are described below. | 32 | runtime PM are described below. |
| 33 | 33 | ||
| 34 | 2. Device Run-time PM Callbacks | 34 | 2. Device Runtime PM Callbacks |
| 35 | 35 | ||
| 36 | There are three device run-time PM callbacks defined in 'struct dev_pm_ops': | 36 | There are three device runtime PM callbacks defined in 'struct dev_pm_ops': |
| 37 | 37 | ||
| 38 | struct dev_pm_ops { | 38 | struct dev_pm_ops { |
| 39 | ... | 39 | ... |
| @@ -72,11 +72,11 @@ knows what to do to handle the device). | |||
| 72 | not mean that the device has been put into a low power state. It is | 72 | not mean that the device has been put into a low power state. It is |
| 73 | supposed to mean, however, that the device will not process data and will | 73 | supposed to mean, however, that the device will not process data and will |
| 74 | not communicate with the CPU(s) and RAM until the subsystem-level resume | 74 | not communicate with the CPU(s) and RAM until the subsystem-level resume |
| 75 | callback is executed for it. The run-time PM status of a device after | 75 | callback is executed for it. The runtime PM status of a device after |
| 76 | successful execution of the subsystem-level suspend callback is 'suspended'. | 76 | successful execution of the subsystem-level suspend callback is 'suspended'. |
| 77 | 77 | ||
| 78 | * If the subsystem-level suspend callback returns -EBUSY or -EAGAIN, | 78 | * If the subsystem-level suspend callback returns -EBUSY or -EAGAIN, |
| 79 | the device's run-time PM status is 'active', which means that the device | 79 | the device's runtime PM status is 'active', which means that the device |
| 80 | _must_ be fully operational afterwards. | 80 | _must_ be fully operational afterwards. |
| 81 | 81 | ||
| 82 | * If the subsystem-level suspend callback returns an error code different | 82 | * If the subsystem-level suspend callback returns an error code different |
| @@ -104,7 +104,7 @@ the device). | |||
| 104 | 104 | ||
| 105 | * Once the subsystem-level resume callback has completed successfully, the PM | 105 | * Once the subsystem-level resume callback has completed successfully, the PM |
| 106 | core regards the device as fully operational, which means that the device | 106 | core regards the device as fully operational, which means that the device |
| 107 | _must_ be able to complete I/O operations as needed. The run-time PM status | 107 | _must_ be able to complete I/O operations as needed. The runtime PM status |
| 108 | of the device is then 'active'. | 108 | of the device is then 'active'. |
| 109 | 109 | ||
| 110 | * If the subsystem-level resume callback returns an error code, the PM core | 110 | * If the subsystem-level resume callback returns an error code, the PM core |
| @@ -130,7 +130,7 @@ device in that case. The value returned by this callback is ignored by the PM | |||
| 130 | core. | 130 | core. |
| 131 | 131 | ||
| 132 | The helper functions provided by the PM core, described in Section 4, guarantee | 132 | The helper functions provided by the PM core, described in Section 4, guarantee |
| 133 | that the following constraints are met with respect to the bus type's run-time | 133 | that the following constraints are met with respect to the bus type's runtime |
| 134 | PM callbacks: | 134 | PM callbacks: |
| 135 | 135 | ||
| 136 | (1) The callbacks are mutually exclusive (e.g. it is forbidden to execute | 136 | (1) The callbacks are mutually exclusive (e.g. it is forbidden to execute |
| @@ -142,7 +142,7 @@ PM callbacks: | |||
| 142 | 142 | ||
| 143 | (2) ->runtime_idle() and ->runtime_suspend() can only be executed for 'active' | 143 | (2) ->runtime_idle() and ->runtime_suspend() can only be executed for 'active' |
| 144 | devices (i.e. the PM core will only execute ->runtime_idle() or | 144 | devices (i.e. the PM core will only execute ->runtime_idle() or |
| 145 | ->runtime_suspend() for the devices the run-time PM status of which is | 145 | ->runtime_suspend() for the devices the runtime PM status of which is |
| 146 | 'active'). | 146 | 'active'). |
| 147 | 147 | ||
| 148 | (3) ->runtime_idle() and ->runtime_suspend() can only be executed for a device | 148 | (3) ->runtime_idle() and ->runtime_suspend() can only be executed for a device |
| @@ -151,7 +151,7 @@ PM callbacks: | |||
| 151 | flag of which is set. | 151 | flag of which is set. |
| 152 | 152 | ||
| 153 | (4) ->runtime_resume() can only be executed for 'suspended' devices (i.e. the | 153 | (4) ->runtime_resume() can only be executed for 'suspended' devices (i.e. the |
| 154 | PM core will only execute ->runtime_resume() for the devices the run-time | 154 | PM core will only execute ->runtime_resume() for the devices the runtime |
| 155 | PM status of which is 'suspended'). | 155 | PM status of which is 'suspended'). |
| 156 | 156 | ||
| 157 | Additionally, the helper functions provided by the PM core obey the following | 157 | Additionally, the helper functions provided by the PM core obey the following |
| @@ -171,9 +171,9 @@ rules: | |||
| 171 | scheduled requests to execute the other callbacks for the same device, | 171 | scheduled requests to execute the other callbacks for the same device, |
| 172 | except for scheduled autosuspends. | 172 | except for scheduled autosuspends. |
| 173 | 173 | ||
| 174 | 3. Run-time PM Device Fields | 174 | 3. Runtime PM Device Fields |
| 175 | 175 | ||
| 176 | The following device run-time PM fields are present in 'struct dev_pm_info', as | 176 | The following device runtime PM fields are present in 'struct dev_pm_info', as |
| 177 | defined in include/linux/pm.h: | 177 | defined in include/linux/pm.h: |
| 178 | 178 | ||
| 179 | struct timer_list suspend_timer; | 179 | struct timer_list suspend_timer; |
| @@ -205,7 +205,7 @@ defined in include/linux/pm.h: | |||
| 205 | 205 | ||
| 206 | unsigned int disable_depth; | 206 | unsigned int disable_depth; |
