aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2010-12-24 15:04:06 +0100
committerRafael J. Wysocki <rjw@sisk.pl>2010-12-24 15:04:06 +0100
commit4b31db8a16fa0d4d6a0fa42d044e7a4f4dad3641 (patch)
tree4075d84f26fdd8e70ec62c9b541caa1ea23cebda
parent5c1a07ab3e78ef68fc9ccf419c969e8ed88d7cb6 (diff)
downloadkernel_samsung_smdk4412-4b31db8a16fa0d4d6a0fa42d044e7a4f4dad3641.zip
kernel_samsung_smdk4412-4b31db8a16fa0d4d6a0fa42d044e7a4f4dad3641.tar.gz
kernel_samsung_smdk4412-4b31db8a16fa0d4d6a0fa42d044e7a4f4dad3641.tar.bz2
PM / Runtime: Generic resume shouldn't set RPM_ACTIVE unconditionally
The __pm_generic_resume() function changes the given device's runtime PM status to RPM_ACTIVE if its driver's callback returns 0, but it only should do that if the rumtime PM is enabled for the device. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-rw-r--r--drivers/base/power/generic_ops.c2
-rw-r--r--include/linux/pm_runtime.h6
2 files changed, 7 insertions, 1 deletions
diff --git a/drivers/base/power/generic_ops.c b/drivers/base/power/generic_ops.c
index 3d2c350..42f97f9 100644
--- a/drivers/base/power/generic_ops.c
+++ b/drivers/base/power/generic_ops.c
@@ -185,7 +185,7 @@ static int __pm_generic_resume(struct device *dev, int event)
return 0;
ret = callback(dev);
- if (!ret) {
+ if (!ret && pm_runtime_enabled(dev)) {
pm_runtime_disable(dev);
pm_runtime_set_active(dev);
pm_runtime_enable(dev);
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index e9cc049..d34f067 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -82,6 +82,11 @@ static inline bool pm_runtime_suspended(struct device *dev)
&& !dev->power.disable_depth;
}
+static inline bool pm_runtime_enabled(struct device *dev)
+{
+ return !dev->power.disable_depth;
+}
+
static inline void pm_runtime_mark_last_busy(struct device *dev)
{
ACCESS_ONCE(dev->power.last_busy) = jiffies;
@@ -120,6 +125,7 @@ static inline void pm_runtime_put_noidle(struct device *dev) {}
static inline bool device_run_wake(struct device *dev) { return false; }
static inline void device_set_run_wake(struct device *dev, bool enable) {}
static inline bool pm_runtime_suspended(struct device *dev) { return false; }
+static inline bool pm_runtime_enabled(struct device *dev) { return false; }
static inline int pm_generic_runtime_idle(struct device *dev) { return 0; }
static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }