Commit f606b358 authored by Dirk Brandewie's avatar Dirk Brandewie Committed by Greg Kroah-Hartman

cpufreq / intel_pstate: Fix max_perf_pct on resume

commit 52e0a509 upstream.

If the system is suspended while max_perf_pct is less than 100 percent
or no_turbo set policy->{min,max} will be set incorrectly with scaled
values which turn the scaled values into hard limits.

References: https://bugzilla.kernel.org/show_bug.cgi?id=61241Reported-by: default avatarPatrick Bartels <petzicus@googlemail.com>
Signed-off-by: default avatarDirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 40f3a9e5
...@@ -629,8 +629,8 @@ static int __cpuinit intel_pstate_cpu_exit(struct cpufreq_policy *policy) ...@@ -629,8 +629,8 @@ static int __cpuinit intel_pstate_cpu_exit(struct cpufreq_policy *policy)
static int __cpuinit intel_pstate_cpu_init(struct cpufreq_policy *policy) static int __cpuinit intel_pstate_cpu_init(struct cpufreq_policy *policy)
{ {
int rc, min_pstate, max_pstate;
struct cpudata *cpu; struct cpudata *cpu;
int rc;
rc = intel_pstate_init_cpu(policy->cpu); rc = intel_pstate_init_cpu(policy->cpu);
if (rc) if (rc)
...@@ -644,9 +644,8 @@ static int __cpuinit intel_pstate_cpu_init(struct cpufreq_policy *policy) ...@@ -644,9 +644,8 @@ static int __cpuinit intel_pstate_cpu_init(struct cpufreq_policy *policy)
else else
policy->policy = CPUFREQ_POLICY_POWERSAVE; policy->policy = CPUFREQ_POLICY_POWERSAVE;
intel_pstate_get_min_max(cpu, &min_pstate, &max_pstate); policy->min = cpu->pstate.min_pstate * 100000;
policy->min = min_pstate * 100000; policy->max = cpu->pstate.turbo_pstate * 100000;
policy->max = max_pstate * 100000;
/* cpuinfo and default policy values */ /* cpuinfo and default policy values */
policy->cpuinfo.min_freq = cpu->pstate.min_pstate * 100000; policy->cpuinfo.min_freq = cpu->pstate.min_pstate * 100000;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment