diff options
| -rw-r--r-- | Documentation/power/devices.txt | 7 | ||||
| -rw-r--r-- | Documentation/power/runtime_pm.txt | 4 | ||||
| -rw-r--r-- | drivers/base/power/main.c | 2 | ||||
| -rw-r--r-- | include/linux/pm_runtime.h | 6 |
4 files changed, 8 insertions, 11 deletions
diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt index d172bce0fd49..8ba6625fdd63 100644 --- a/Documentation/power/devices.txt +++ b/Documentation/power/devices.txt | |||
| @@ -341,6 +341,13 @@ the phases are: | |||
| 341 | and is entirely responsible for bringing the device back to the | 341 | and is entirely responsible for bringing the device back to the |
| 342 | functional state as appropriate. | 342 | functional state as appropriate. |
| 343 | 343 | ||
| 344 | Note that this direct-complete procedure applies even if the device is | ||
| 345 | disabled for runtime PM; only the runtime-PM status matters. It follows | ||
| 346 | that if a device has system-sleep callbacks but does not support runtime | ||
| 347 | PM, then its prepare callback must never return a positive value. This | ||
| 348 | is because all devices are initially set to runtime-suspended with | ||
| 349 | runtime PM disabled. | ||
| 350 | |||
| 344 | 2. The suspend methods should quiesce the device to stop it from performing | 351 | 2. The suspend methods should quiesce the device to stop it from performing |
| 345 | I/O. They also may save the device registers and put it into the | 352 | I/O. They also may save the device registers and put it into the |
| 346 | appropriate low-power state, depending on the bus type the device is on, | 353 | appropriate low-power state, depending on the bus type the device is on, |
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt index e76dc0ad4d2b..0784bc3a2ab5 100644 --- a/Documentation/power/runtime_pm.txt +++ b/Documentation/power/runtime_pm.txt | |||
| @@ -445,10 +445,6 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
| 445 | bool pm_runtime_status_suspended(struct device *dev); | 445 | bool pm_runtime_status_suspended(struct device *dev); |
| 446 | - return true if the device's runtime PM status is 'suspended' | 446 | - return true if the device's runtime PM status is 'suspended' |
| 447 | 447 | ||
| 448 | bool pm_runtime_suspended_if_enabled(struct device *dev); | ||
| 449 | - return true if the device's runtime PM status is 'suspended' and its | ||
| 450 | 'power.disable_depth' field is equal to 1 | ||
| 451 | |||
| 452 | void pm_runtime_allow(struct device *dev); | 448 | void pm_runtime_allow(struct device *dev); |
| 453 | - set the power.runtime_auto flag for the device and decrease its usage | 449 | - set the power.runtime_auto flag for the device and decrease its usage |
| 454 | counter (used by the /sys/devices/.../power/control interface to | 450 | counter (used by the /sys/devices/.../power/control interface to |
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 30b7bbfdc558..1710c26ba097 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
| @@ -1377,7 +1377,7 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async) | |||
| 1377 | if (dev->power.direct_complete) { | 1377 | if (dev->power.direct_complete) { |
| 1378 | if (pm_runtime_status_suspended(dev)) { | 1378 | if (pm_runtime_status_suspended(dev)) { |
| 1379 | pm_runtime_disable(dev); | 1379 | pm_runtime_disable(dev); |
| 1380 | if (pm_runtime_suspended_if_enabled(dev)) | 1380 | if (pm_runtime_status_suspended(dev)) |
| 1381 | goto Complete; | 1381 | goto Complete; |
| 1382 | 1382 | ||
| 1383 | pm_runtime_enable(dev); | 1383 | pm_runtime_enable(dev); |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 30e84d48bfea..3bdbb4189780 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
| @@ -98,11 +98,6 @@ static inline bool pm_runtime_status_suspended(struct device *dev) | |||
| 98 | return dev->power.runtime_status == RPM_SUSPENDED; | 98 | return dev->power.runtime_status == RPM_SUSPENDED; |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | static inline bool pm_runtime_suspended_if_enabled(struct device *dev) | ||
| 102 | { | ||
| 103 | return pm_runtime_status_suspended(dev) && dev->power.disable_depth == 1; | ||
| 104 | } | ||
| 105 | |||
| 106 | static inline bool pm_runtime_enabled(struct device *dev) | 101 | static inline bool pm_runtime_enabled(struct device *dev) |
| 107 | { | 102 | { |
| 108 | return !dev->power.disable_depth; | 103 | return !dev->power.disable_depth; |
| @@ -164,7 +159,6 @@ static inline void device_set_run_wake(struct device *dev, bool enable) {} | |||
| 164 | static inline bool pm_runtime_suspended(struct device *dev) { return false; } | 159 | static inline bool pm_runtime_suspended(struct device *dev) { return false; } |
| 165 | static inline bool pm_runtime_active(struct device *dev) { return true; } | 160 | static inline bool pm_runtime_active(struct device *dev) { return true; } |
| 166 | static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } | 161 | static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } |
| 167 | static inline bool pm_runtime_suspended_if_enabled(struct device *dev) { return false; } | ||
| 168 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } | 162 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } |
| 169 | 163 | ||
| 170 | static inline void pm_runtime_no_callbacks(struct device *dev) {} | 164 | static inline void pm_runtime_no_callbacks(struct device *dev) {} |
