All of lore.kernel.org
 help / color / mirror / Atom feed
From: MyungJoo Ham <myungjoo.ham@samsung.com>
To: Nishanth Menon <nm@ti.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>
Cc: 박경민 <kyungmin.park@samsung.com>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	"Kevin Hilman" <khilman@ti.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] PM / OPP: predictable fail results for opp_find* functions
Date: Thu, 18 Oct 2012 02:30:09 +0000 (GMT)	[thread overview]
Message-ID: <25178027.160161350527407382.JavaMail.weblogic@epml06> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=euc-kr, Size: 1492 bytes --]

> 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);
> 
> Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
> Cc: Kevin Hilman <khilman@ti.com>
> Cc: linux-pm@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> 
> Signed-off-by: Nishanth Menon <nm@ti.com>

Thanks.


Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>


> 
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

             reply	other threads:[~2012-10-18  2:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-18  2:30 MyungJoo Ham [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-10-11 13:40 [PATCH] PM / OPP: predictable fail results for opp_find* functions Nishanth Menon
2012-10-17 22:14 ` Kevin Hilman
2012-10-18 23:18   ` Rafael J. Wysocki

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=25178027.160161350527407382.JavaMail.weblogic@epml06 \
    --to=myungjoo.ham@samsung.com \
    --cc=khilman@ti.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=rjw@sisk.pl \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.