[Intel-gfx] [PATCH v2] PM / Runtime: Introduce pm_runtime_get_noidle

Rafael J. Wysocki rjw at rjwysocki.net
Sun Dec 13 18:04:20 PST 2015


On Saturday, December 12, 2015 07:49:56 PM Chris Wilson wrote:
> On Sat, Dec 12, 2015 at 09:40:45PM +0200, Imre Deak wrote:
> > On Sat, 2015-12-12 at 02:51 +0100, Rafael J. Wysocki wrote:
> > > +bool pm_runtime_get_if_in_use(struct device *dev)
> > > +{
> > > +	unsigned long flags;
> > > +	bool retval;
> > > +
> > > +	spin_lock_irqsave(&dev->power.lock, flags);
> > > +	retval = dev->power.runtime_status == RPM_ACTIVE ?
> > > +		!!atomic_inc_not_zero(&dev->power.usage_count) :
> > > false;
> > > +	spin_unlock_irqrestore(&dev->power.lock, flags);
> > > +	return retval;
> > > +}
> > > +EXPORT_SYMBOL_GPL(pm_runtime_get_if_in_use);
> > > +
> > 
> > To me this looks ok:
> > Acked-by: Imre Deak <imre.deak at intel.com>
> 
> Pendant says
> retval = (dev->power.runtime_status == RPM_ACTIVE &&
> 	  atomic_inc_not_zero(&dev->power.usage_count);

Well, this wouldn't build AFAICS.

retval = dev->power.runtime_status == RPM_ACTIVE &&
	atomic_inc_not_zero(&dev->power.usage_count);

Thanks,
Rafael



More information about the Intel-gfx mailing list