From: Aaron Lu <aaron.lu@intel.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Linux-pm mailing list <linux-pm@vger.kernel.org>,
lkp@01.org, Fengguang Wu <fengguang.wu@intel.com>
Subject: [LKP] Unable to change cpufreq governor
Date: Fri, 12 Sep 2014 13:22:54 +0800 [thread overview]
Message-ID: <5412832E.7000406@intel.com> (raw)
Hi Viresh,
The script used in LKP to change cpufreq governor triggered a lot of
errors on different test boxes with your branch:
https://git.linaro.org/people/vireshk/linux cpufreq/governor-fixes
[root@localhost cpufreq]# pwd
/sys/devices/system/cpu/cpu3/cpufreq
[root@localhost cpufreq]# echo ondemand > scaling_governor
bash: echo: write error: Device or resource busy
This only occurs for acpi-cpufreq scaling driver.
After turned on the debug level:
[root@localhost ~]# echo 'module cpufreq +pft' > /sys/kernel/debug/dynamic_debug/control
And added a little more debug statements:
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 051d566dc522..4175b1cf7995 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2009,7 +2009,7 @@ EXPORT_SYMBOL_GPL(cpufreq_driver_target);
static int __cpufreq_governor(struct cpufreq_policy *policy,
unsigned int event)
{
- int ret, state;
+ int ret, state, busy;
/* Only must be defined when default governor is known to have latency
restrictions, like e.g. conservative or ondemand.
@@ -2046,9 +2046,12 @@ static int __cpufreq_governor(struct cpufreq_policy *policy,
mutex_lock(&cpufreq_governor_lock);
state = get_governor_state(policy);
+ pr_debug("state=%u\n", state);
/* Check if operation is permitted or not */
- if (is_governor_busy(policy)
+ busy = is_governor_busy(policy);
+ pr_debug("busy=%d\n", busy);
+ if (busy
|| (state == CPUFREQ_GOV_START && event != CPUFREQ_GOV_LIMITS && event != CPUFREQ_GOV_STOP)
|| (state == CPUFREQ_GOV_STOP && event != CPUFREQ_GOV_START && event != CPUFREQ_GOV_POLICY_EXIT)
|| (state == CPUFREQ_GOV_POLICY_INIT && event != CPUFREQ_GOV_START && event != CPUFREQ_GOV_POLICY_EXIT)
the following output is printed with the above echo command:
[ 61.869713] [1263] cpufreq_set_policy: cpufreq: setting new policy for CPU 3: 1600000 - 3401000 kHz
[ 61.869732] [1263] cpufreq_set_policy: cpufreq: new min and max freqs are 1600000 - 3401000 kHz
[ 61.869734] [1263] cpufreq_set_policy: cpufreq: governor switch
[ 61.869736] [1263] __cpufreq_governor: cpufreq: __cpufreq_governor for CPU 3, event 2
[ 61.869739] [1263] __cpufreq_governor: cpufreq: state=5
[ 61.869741] [1263] __cpufreq_governor: cpufreq: busy=0
Please let me know if you need more information, thanks.
-Aaron
next reply other threads:[~2014-09-12 5:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-12 5:22 Aaron Lu [this message]
2014-09-29 9:03 ` [LKP] Unable to change cpufreq governor 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=5412832E.7000406@intel.com \
--to=aaron.lu@intel.com \
--cc=fengguang.wu@intel.com \
--cc=linux-pm@vger.kernel.org \
--cc=lkp@01.org \
--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;
as well as URLs for NNTP newsgroup(s).