summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2020-03-06 12:49:56 +0100
committerIngo Molnar <mingo@kernel.org>2020-03-06 12:49:56 +0100
commit1b10d388d094bb32129060236add6f50b204a69d (patch)
tree08272a4d89833d139e615b07675f95e403cdddbd /drivers/cpufreq
parenta0f03b617c3b2644d3d47bf7d9e60aed01bd5b10 (diff)
parent8b614cb8f1dcac8ca77cf4dd85f46ef3055f8238 (diff)
downloadlinux-1b10d388d094bb32129060236add6f50b204a69d.tar.gz
linux-1b10d388d094bb32129060236add6f50b204a69d.tar.bz2
linux-1b10d388d094bb32129060236add6f50b204a69d.zip
Merge branch 'linus' into sched/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index cbe6c94bf158..808874bccf4a 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1076,9 +1076,17 @@ static int cpufreq_init_policy(struct cpufreq_policy *policy)
pol = policy->last_policy;
} else if (def_gov) {
pol = cpufreq_parse_policy(def_gov->name);
- } else {
- return -ENODATA;
+ /*
+ * In case the default governor is neiter "performance"
+ * nor "powersave", fall back to the initial policy
+ * value set by the driver.
+ */
+ if (pol == CPUFREQ_POLICY_UNKNOWN)
+ pol = policy->policy;
}
+ if (pol != CPUFREQ_POLICY_PERFORMANCE &&
+ pol != CPUFREQ_POLICY_POWERSAVE)
+ return -ENODATA;
}
return cpufreq_set_policy(policy, gov, pol);