From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux PM list <linux-pm@vger.kernel.org>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Viresh Kumar <viresh.kumar@linaro.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/5] cpufreq: governor: CPUFREQ_GOV_LIMITS never fails
Date: Sat, 14 May 2016 00:59:27 +0200 [thread overview]
Message-ID: <4856300.OoAS5drrzx@vostro.rjw.lan> (raw)
In-Reply-To: <10707470.yIcqGAzuFY@vostro.rjw.lan>
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
None of the cpufreq governors currently in the tree will ever fail
an invocation of the ->governor() callback with the event argument
equal to CPUFREQ_GOV_LIMITS (unless invoked with incorrect arguments
which doesn't matter anyway) and had it ever failed, the result of
it wouldn't have been very clean.
For this reason, rearrange the code in the core to ignore the return
value of cpufreq_governor() when called with event equal to
CPUFREQ_GOV_LIMITS.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/cpufreq/cpufreq.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
Index: linux-pm/drivers/cpufreq/cpufreq.c
===================================================================
--- linux-pm.orig/drivers/cpufreq/cpufreq.c
+++ linux-pm/drivers/cpufreq/cpufreq.c
@@ -2054,7 +2054,11 @@ static int cpufreq_start_governor(struct
cpufreq_update_current_freq(policy);
ret = cpufreq_governor(policy, CPUFREQ_GOV_START);
- return ret ? ret : cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
+ if (ret)
+ return ret;
+
+ cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
+ return 0;
}
int cpufreq_register_governor(struct cpufreq_governor *governor)
@@ -2195,7 +2199,8 @@ static int cpufreq_set_policy(struct cpu
if (new_policy->governor == policy->governor) {
pr_debug("cpufreq: governor limits update\n");
- return cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
+ cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
+ return 0;
}
pr_debug("governor switch\n");
next prev parent reply other threads:[~2016-05-13 22:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-13 22:58 [PATCH 0/5] cpufreq: governor: Rework API to use callbacks instead of events Rafael J. Wysocki
2016-05-13 22:59 ` Rafael J. Wysocki [this message]
2016-05-13 23:00 ` [PATCH 2/5] cpufreq: governor: Check transition latecy at init time only Rafael J. Wysocki
2016-05-13 23:01 ` [PATCH 3/5] cpufreq: governor: Simplify performance and powersave governors Rafael J. Wysocki
2016-05-13 23:01 ` [PATCH 4/5] cpufreq: Split cpufreq_governor() into simpler functions Rafael J. Wysocki
2016-05-13 23:02 ` [PATCH 5/5] cpufreq: governor: Get rid of governor events Rafael J. Wysocki
2016-05-16 4:54 ` Viresh Kumar
2016-05-16 4:55 ` [PATCH 0/5] cpufreq: governor: Rework API to use callbacks instead of events Viresh Kumar
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=4856300.OoAS5drrzx@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=srinivas.pandruvada@linux.intel.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