On Wed, 15 Dec 2010, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki <rjw@xxxxxxx> > Subject: PM / Runtime: Fix pm_runtime_suspended() > > pm_runtime_suspended() shouldn't return true if the runtime PM of the > given device is disabled. > > Signed-off-by: Rafael J. Wysocki <rjw@xxxxxxx> > --- > include/linux/pm_runtime.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > Index: linux-2.6/include/linux/pm_runtime.h > =================================================================== > --- linux-2.6.orig/include/linux/pm_runtime.h > +++ linux-2.6/include/linux/pm_runtime.h > @@ -78,7 +78,8 @@ static inline void device_set_run_wake(s > > static inline bool pm_runtime_suspended(struct device *dev) > { > - return dev->power.runtime_status == RPM_SUSPENDED; > + return dev->power.runtime_status == RPM_SUSPENDED > + && !dev->power.disable_depth; > } You need to update the documentation entry for pm_runtime_suspended as well. I think this is okay. If a driver or subsystem uses pm_runtime_suspended() then it must be runtime-PM-aware, so it wouldn't leave a device disabled for runtime PM. So in theory the only place this would matter is if the function is called in a generic setting, and AFAICT the only place that happens is in generic_ops.c, where the change is correct. Alan Stern _______________________________________________ linux-pm mailing list linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/linux-pm