aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorDirk Brandewie <dirk.j.brandewie@intel.com>2013-07-18 11:48:42 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-07-22 22:18:28 -0400
commit2134ed4d614349b2b4e8d7bb593baa9179b8dd1e (patch)
tree044cff8a3f4c619bfd077ebaa65a1ae2693d47e4 /drivers/cpufreq
parent3b2f64d00c46e1e4e9bd0bb9bb12619adac27a4b (diff)
cpufreq / intel_pstate: Change to scale off of max P-state
Change to using max P-state instead of max turbo P-state. This change resolves two issues. On a quiet system intel_pstate can fail to respond to a load change. On CPU SKUs that have a limited number of P-states and no turbo range intel_pstate fails to select the highest available P-state. This change is suitable for stable v3.9+ References: https://bugzilla.kernel.org/show_bug.cgi?id=59481 Reported-and-tested-by: Arjan van de Ven <arjan@linux.intel.com> Reported-and-tested-by: dsmythies@telus.net Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Cc: 3.9+ <stable@vger.kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/intel_pstate.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index b012d7600e1a..7cde885011ed 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -103,10 +103,10 @@ struct pstate_adjust_policy {
103static struct pstate_adjust_policy default_policy = { 103static struct pstate_adjust_policy default_policy = {
104 .sample_rate_ms = 10, 104 .sample_rate_ms = 10,
105 .deadband = 0, 105 .deadband = 0,
106 .setpoint = 109, 106 .setpoint = 97,
107 .p_gain_pct = 17, 107 .p_gain_pct = 20,
108 .d_gain_pct = 0, 108 .d_gain_pct = 0,
109 .i_gain_pct = 4, 109 .i_gain_pct = 0,
110}; 110};
111 111
112struct perf_limits { 112struct perf_limits {
@@ -468,12 +468,12 @@ static inline void intel_pstate_set_sample_time(struct cpudata *cpu)
468static inline int intel_pstate_get_scaled_busy(struct cpudata *cpu) 468static inline int intel_pstate_get_scaled_busy(struct cpudata *cpu)
469{ 469{
470 int32_t busy_scaled; 470 int32_t busy_scaled;
471 int32_t core_busy, turbo_pstate, current_pstate; 471 int32_t core_busy, max_pstate, current_pstate;
472 472
473 core_busy = int_tofp(cpu->samples[cpu->sample_ptr].core_pct_busy); 473 core_busy = int_tofp(cpu->samples[cpu->sample_ptr].core_pct_busy);
474 turbo_pstate = int_tofp(cpu->pstate.turbo_pstate); 474 max_pstate = int_tofp(cpu->pstate.max_pstate);
475 current_pstate = int_tofp(cpu->pstate.current_pstate); 475 current_pstate = int_tofp(cpu->pstate.current_pstate);
476 busy_scaled = mul_fp(core_busy, div_fp(turbo_pstate, current_pstate)); 476 busy_scaled = mul_fp(core_busy, div_fp(max_pstate, current_pstate));
477 477
478 return fp_toint(busy_scaled); 478 return fp_toint(busy_scaled);
479} 479}