diff options
author | 2020-03-25 16:18:09 +0100 | |
---|---|---|
committer | 2020-03-26 20:30:11 +0100 | |
commit | 5ac54113dd6fed13a65048bf820d73c058c7440d (patch) | |
tree | 76bd8a1e59a2c893d7f7a67c1ee8b2015d6d39d3 /drivers/cpufreq | |
parent | Merge branch 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/k... (diff) | |
download | linux-5ac54113dd6fed13a65048bf820d73c058c7440d.tar.gz linux-5ac54113dd6fed13a65048bf820d73c058c7440d.tar.bz2 linux-5ac54113dd6fed13a65048bf820d73c058c7440d.zip |
cpufreq: intel_pstate: Simplify intel_pstate_cpu_init()
The initial policy value set by intel_pstate_cpu_init() depends on
whether or not CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is set, but
that is not necessary, because the core will set the policy to
"performance" in cpufreq_init_policy() if the default governor is
"performance" anyway.
Accordingly, change intel_pstate_cpu_init() to always set policy
to CPUFREQ_POLICY_POWERSAVE initially to provide a valid fallback
value to cpufreq_init_policy() in case the default cpufreq governor
is neither "powersave" nor "performance".
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/intel_pstate.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 404982d655e2..d2297839374d 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -2247,10 +2247,11 @@ static int intel_pstate_cpu_init(struct cpufreq_policy *policy) if (ret) return ret; - if (IS_ENABLED(CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE)) - policy->policy = CPUFREQ_POLICY_PERFORMANCE; - else - policy->policy = CPUFREQ_POLICY_POWERSAVE; + /* + * Set the policy to powersave to provide a valid fallback value in case + * the default cpufreq governor is neither powersave nor performance. + */ + policy->policy = CPUFREQ_POLICY_POWERSAVE; return 0; } |