lkml.org 
[lkml]   [2012]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] PM / OPP: predictable fail results for opp_find* functions
Date
On Wednesday 17 of October 2012 15:14:22 Kevin Hilman wrote:
> Nishanth Menon <nm@ti.com> writes:
>
> > Currently the opp_find* functions return -ENODEV when:
> > a) it cant find a device (e.g. request for an OPP search on device
> > which was not registered)
> > b) When it cant find a match for the search strategy used
> >
> > This makes life a little in-efficient for users such as devfreq
> > to make reasonable judgement before switching search strategies.
> >
> > So, standardize the return results as following:
> > -EINVAL for bad pointer parameters
> > -ENODEV when device cannot be found
> > -ERANGE when search fails
> >
> > This has the following benefit for devfreq implementation:
> >
> > Current code:
> > opp = opp_find_freq_floor(dev, freq);
> > /* Following search triggers even for un-registered device */
> > if (opp == ERR_PTR(-ENODEV))
> > opp = opp_find_freq_ceil(dev, freq);
> >
> > Vs (after this change):
> > opp = opp_find_freq_floor(dev, freq);
> > /* Will only be triggered if search logic fails: intended usage */
> > if (opp == ERR_PTR(-ERANGE))
> > opp = opp_find_freq_ceil(dev, freq);
>
> I think the idea is fine but would prefer to see the benefits summarized
> in words, rather than code.
>
> Also, the changelog should describe that the patch not only changes the
> meaning of return values, but also converts devfreq to use the new
> values.
>
> Otherwise, implementation looks fine.
>
> Reviewed-by: Kevin Hilman <khilman@ti.com>

Can you please update the patch as requested by Kevin?

Thanks,
Rafael


--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.


\
 
 \ /
  Last update: 2012-10-19 02:01    [W:0.072 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site