aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk Brandewie <dirk.j.brandewie@intel.com>2013-10-15 14:06:14 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-15 19:41:46 -0400
commit52e0a509e5d6f902ec26bc2a8bb02b137dc453be (patch)
tree3cc6554ec6a077340bab9f47ebf9297c0b1c02bd
parent35f9162d67c3e20a82b4bd6ec538f3e9c14fb055 (diff)
cpufreq / intel_pstate: Fix max_perf_pct on resume
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=61241 Reported-by: Patrick Bartels <petzicus@googlemail.com> Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com> Cc: 3.9+ <stable@vger.kernel.org> # 3.9+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/cpufreq/intel_pstate.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 32b3479a2405..28fefe3dd731 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -637,8 +637,8 @@ static int intel_pstate_cpu_exit(struct cpufreq_policy *policy)
637 637
638static int intel_pstate_cpu_init(struct cpufreq_policy *policy) 638static int intel_pstate_cpu_init(struct cpufreq_policy *policy)
639{ 639{
640 int rc, min_pstate, max_pstate;
641 struct cpudata *cpu; 640 struct cpudata *cpu;
641 int rc;
642 642
643 rc = intel_pstate_init_cpu(policy->cpu); 643 rc = intel_pstate_init_cpu(policy->cpu);
644 if (rc) 644 if (rc)
@@ -652,9 +652,8 @@ static int intel_pstate_cpu_init(struct cpufreq_policy *policy)
652 else 652 else
653 policy->policy = CPUFREQ_POLICY_POWERSAVE; 653 policy->policy = CPUFREQ_POLICY_POWERSAVE;
654 654
655 intel_pstate_get_min_max(cpu, &min_pstate, &max_pstate); 655 policy->min = cpu->pstate.min_pstate * 100000;
656 policy->min = min_pstate * 100000; 656 policy->max = cpu->pstate.turbo_pstate * 100000;
657 policy->max = max_pstate * 100000;
658 657
659 /* cpuinfo and default policy values */ 658 /* cpuinfo and default policy values */
660 policy->cpuinfo.min_freq = cpu->pstate.min_pstate * 100000; 659 policy->cpuinfo.min_freq = cpu->pstate.min_pstate * 100000;