[Intel-gfx] [PATCH v2] PM / Runtime: Introduce pm_runtime_get_noidle
Chris Wilson
chris at chris-wilson.co.uk
Sat Dec 12 11:49:56 PST 2015
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);
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list