From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: cpufreq@vger.kernel.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linaro-dev@lists.linaro.org, patches@linaro.org,
pdsw-power-team@arm.com
Subject: Re: [PATCH] cpufreq: Avoid calling cpufreq driver's target() routine if target_freq == policy->cur
Date: Fri, 26 Oct 2012 13:17:12 +0200 [thread overview]
Message-ID: <5056958.0bPciFrxt5@vostro.rjw.lan> (raw)
In-Reply-To: <1d7b6e421a335255da956804b43ce3517538409c.1351244153.git.viresh.kumar@linaro.org>
On Friday, October 26, 2012 03:06:26 PM Viresh Kumar wrote:
> Avoid calling cpufreq driver's target() routine if new frequency is same as
> policies current frequency.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Looks reasonable.
Any objection from anyone?
Rafael
> ---
> drivers/cpufreq/cpufreq.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 261ef65..28dc134 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -1476,6 +1476,10 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
>
> pr_debug("target for CPU %u: %u kHz, relation %u\n", policy->cpu,
> target_freq, relation);
> +
> + if (target_freq == policy->cur)
> + return 0;
> +
> if (cpu_online(policy->cpu) && cpufreq_driver->target)
> retval = cpufreq_driver->target(policy, target_freq, relation);
>
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
next prev parent reply other threads:[~2012-10-26 11:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-26 9:36 [PATCH] cpufreq: Avoid calling cpufreq driver's target() routine if target_freq == policy->cur Viresh Kumar
2012-10-26 11:17 ` Rafael J. Wysocki [this message]
[not found] ` <5056958.0bPciFrxt5-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org>
2012-10-31 0:44 ` 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=5056958.0bPciFrxt5@vostro.rjw.lan \
--to=rjw@sisk.pl \
--cc=cpufreq@vger.kernel.org \
--cc=linaro-dev@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=patches@linaro.org \
--cc=pdsw-power-team@arm.com \
--cc=viresh.kumar@linaro.org \
/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