lkml.org 
[lkml]   [2011]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 3/5] PM: Support for system-wide power transitions in generic power domains
Date
On Wednesday, May 11, 2011, Jonathan Corbet wrote:
> Hi, Rafael,
>
> One small question that came to mind as I was looking at this patch:
>
> > +/**
> > + * pm_genpd_powered_down - Check if power has been removed from a power domain.
> > + * @genpd: Power domain to check.
> > + */
> > +static bool pm_genpd_powered_down(struct generic_power_domain *genpd)
> > +{
> > + bool ret;
> > +
> > + mutex_lock(&genpd->lock);
> > + ret = genpd->power_is_off;
> > + mutex_unlock(&genpd->lock);
> > +
> > + return ret;
>
> I'm not quite sure why this function exists? The lock doesn't really
> change anything, since the power state can change before or after this
> check regardless. If you need the power state to be stable, it seems like
> the lock needs to be taken further up the stack; otherwise simply checking
> genpd->power_is_off directly would seem to be sufficient. Am I missing
> something?

No, you aren't. :-)

In fact, the function doesn't exist any more in the most recent version
of the patch: https://patchwork.kernel.org/patch/775412/

Thanks,
Rafael


\
 
 \ /
  Last update: 2011-05-11 21:13    [W:0.075 / U:5.184 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site