* [LKP] Unable to change cpufreq governor
@ 2014-09-12 5:22 Aaron Lu
2014-09-29 9:03 ` Viresh Kumar
0 siblings, 1 reply; 2+ messages in thread
From: Aaron Lu @ 2014-09-12 5:22 UTC (permalink / raw)
To: Viresh Kumar; +Cc: Linux-pm mailing list, lkp, Fengguang Wu
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-29 9:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-12 5:22 [LKP] Unable to change cpufreq governor Aaron Lu
2014-09-29 9:03 ` Viresh Kumar
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).