diff options
| author | Jim Wylder <jwylder@motorola.com> | 2014-07-28 16:01:15 -0500 |
|---|---|---|
| committer | Jim Wylder <jwylder@motorola.com> | 2014-07-28 16:59:11 -0500 |
| commit | 3386ca0b87e167f323010f487e7e40662dba6e18 (patch) | |
| tree | 049ad98bf1acf34b8e114517f95ac138a36da506 | |
| parent | abbfcac57d628b96bd64d4e3e2dc2df8610e3706 (diff) | |
| download | olio-linux-3.10-3386ca0b87e167f323010f487e7e40662dba6e18.tar.xz olio-linux-3.10-3386ca0b87e167f323010f487e7e40662dba6e18.zip | |
IKXCLOCK-3293 PM: allow device_complete to call pm_runtime_put_noidle
In device_prepare pm_runtime_get_noresume is called to prevent
pm_runtime_suspend during system suspend. The corresponding
release in device_complete, calls pm_runtime_put, rather than
pm_runtime_put_noidle(). This short-circuits any autosuspend
timeouts and immediately suspends the device.
Unfortunately, just directly calling pm_runtime_put_noidle() will
leave some existing devices active indefinitely. Add a flag
to identify devices that can safely call pm_runtime_put_noidle() and
use this from device_complete.
An alternate solution, would be to determine if there is a pending
autosuspend timeout on the device and call the appropriate call
based on this state. This check would have to be done atomically
and would probably be more intrusive to the pm_runtime code.
Change-Id: I9adbd3c1f1ab42565161d3c1b932e795408c72ae
Signed-off-by: Jim Wylder <jwylder@motorola.com>
| -rw-r--r-- | drivers/base/power/main.c | 5 | ||||
| -rw-r--r-- | include/linux/pm.h | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 6a33dd85c04..bf6d932d996 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -817,7 +817,10 @@ static void device_complete(struct device *dev, pm_message_t state) device_unlock(dev); - pm_runtime_put(dev); + if (dev->power.resume_noidle) + pm_runtime_put_noidle(dev); + else + pm_runtime_put(dev); } /** diff --git a/include/linux/pm.h b/include/linux/pm.h index a224c7f5c37..d72e7b30afe 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -560,6 +560,7 @@ struct dev_pm_info { unsigned long suspended_jiffies; unsigned long accounting_timestamp; #endif + bool resume_noidle; struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */ struct dev_pm_qos *qos; }; |