From: Mark Brown <broonie@kernel.org>
To: Viresh Kumar <viresh.kumar@linaro.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>
Cc: cpufreq@vger.kernel.org, linux-pm@vger.kernel.org,
Mark Brown <broonie@linaro.org>
Subject: [PATCH] cpufreq: Fix runtime warnings on systems with shared core clocks
Date: Tue, 2 Jul 2013 01:17:07 +0100 [thread overview]
Message-ID: <1372724227-17209-1-git-send-email-broonie@kernel.org> (raw)
From: Mark Brown <broonie@linaro.org>
Commit 7c30ed ("cpufreq: make sure frequency transitions are serialized")
interacts poorly with systems that have a single core freqency for all
cores. On such systems we have a single policy for all cores with
several CPUs. When we do a frequency transition the governor calls the
pre and post change notifiers which causes cpufreq_notify_transition()
per CPU. Since the policy is the same for all of them all CPUs after
the first and the warnings added are generated by checking a per-policy
flag the warnings will be triggered for all cores after the first.
Fix this by simply reverting commit 7c30ed, though it appears that the
desired behaviour can also be achieved by moving the checks (and
probably some of the other code) out of the per-cpu callback into the
main cpufreq_notify_transition().
Signed-off-by: Mark Brown <broonie@linaro.org>
---
I'll try to have a look at doing the code motion fix tomorrow if that's
more suitable, the check seems like a good idea and looking at the code
it's probably sensible to factor out more of the changes.
drivers/cpufreq/cpufreq.c | 14 --------------
include/linux/cpufreq.h | 1 -
2 files changed, 15 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index b557503..0b3076c 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -312,12 +312,6 @@ static void __cpufreq_notify_transition(struct cpufreq_policy *policy,
switch (state) {
case CPUFREQ_PRECHANGE:
- if (WARN(policy->transition_ongoing,
- "In middle of another frequency transition\n"))
- return;
-
- policy->transition_ongoing = true;
-
/* detect if the driver reported a value as "old frequency"
* which is not equal to what the cpufreq core thinks is
* "old frequency".
@@ -337,12 +331,6 @@ static void __cpufreq_notify_transition(struct cpufreq_policy *policy,
break;
case CPUFREQ_POSTCHANGE:
- if (WARN(!policy->transition_ongoing,
- "No frequency transition in progress\n"))
- return;
-
- policy->transition_ongoing = false;
-
adjust_jiffies(CPUFREQ_POSTCHANGE, freqs);
pr_debug("FREQ: %lu - CPU: %lu", (unsigned long)freqs->new,
(unsigned long)freqs->cpu);
@@ -1552,8 +1540,6 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
if (cpufreq_disabled())
return -ENODEV;
- if (policy->transition_ongoing)
- return -EBUSY;
/* Make sure that target_freq is within supported range */
if (target_freq > policy->max)
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 4d7390b..5fedb6c 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -119,7 +119,6 @@ struct cpufreq_policy {
struct kobject kobj;
struct completion kobj_unregister;
- bool transition_ongoing; /* Tracks transition status */
};
#define CPUFREQ_ADJUST (0)
--
1.8.3.1
next reply other threads:[~2013-07-02 0:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-02 0:17 Mark Brown [this message]
2013-07-02 5:15 ` [PATCH] cpufreq: Fix runtime warnings on systems with shared core clocks Viresh Kumar
2013-07-02 9:48 ` Mark Brown
2013-07-02 10:02 ` Viresh Kumar
2013-07-02 10:29 ` Mark Brown
2013-07-02 10:32 ` Viresh Kumar
2013-07-02 11:15 ` Mark Brown
2013-07-02 12:28 ` 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=1372724227-17209-1-git-send-email-broonie@kernel.org \
--to=broonie@kernel.org \
--cc=broonie@linaro.org \
--cc=cpufreq@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@sisk.pl \
--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