Re: pm_runtime_suspended() and non-pm_runtime-using (i2c) drivers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday, December 15, 2010, Alan Stern wrote:
> 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.

Yes, I also need to rework the changelog to explain what exactly the problem is.

> 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.

Indeed.

Thanks,
Rafael
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux