mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Nishanth Menon <nm@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>,
	linux-pm@vger.kernel.org, MyungJoo Ham <myungjoo.ham@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PM / OPP: predictable fail results for opp_find* functions
Date: Fri, 19 Oct 2012 01:18:34 +0200	[thread overview]
Message-ID: <2693710.XDXEuG0qLO@vostro.rjw.lan> (raw)
In-Reply-To: <87obk0kapt.fsf@deeprootsystems.com>

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.

  reply	other threads:[~2012-10-18 23:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-11 13:40 Nishanth Menon
2012-10-17 22:14 ` Kevin Hilman
2012-10-18 23:18   ` Rafael J. Wysocki [this message]
2012-10-18  2:30 MyungJoo Ham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2693710.XDXEuG0qLO@vostro.rjw.lan \
    --to=rjw@sisk.pl \
    --cc=khilman@deeprootsystems.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=nm@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®