Commit 2134ed4d authored by Dirk Brandewie's avatar Dirk Brandewie Committed by Rafael J. Wysocki

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=59481Reported-and-tested-by: default avatarArjan van de Ven <arjan@linux.intel.com>
Reported-and-tested-by: dsmythies@telus.net
Signed-off-by: default avatarDirk Brandewie <dirk.j.brandewie@intel.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Cc: 3.9+ <stable@vger.kernel.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 3b2f64d0
...@@ -103,10 +103,10 @@ struct pstate_adjust_policy { ...@@ -103,10 +103,10 @@ struct pstate_adjust_policy {
static struct pstate_adjust_policy default_policy = { static struct pstate_adjust_policy default_policy = {
.sample_rate_ms = 10, .sample_rate_ms = 10,
.deadband = 0, .deadband = 0,
.setpoint = 109, .setpoint = 97,
.p_gain_pct = 17, .p_gain_pct = 20,
.d_gain_pct = 0, .d_gain_pct = 0,
.i_gain_pct = 4, .i_gain_pct = 0,
}; };
struct perf_limits { struct perf_limits {
...@@ -468,12 +468,12 @@ static inline void intel_pstate_set_sample_time(struct cpudata *cpu) ...@@ -468,12 +468,12 @@ static inline void intel_pstate_set_sample_time(struct cpudata *cpu)
static inline int intel_pstate_get_scaled_busy(struct cpudata *cpu) static inline int intel_pstate_get_scaled_busy(struct cpudata *cpu)
{ {
int32_t busy_scaled; int32_t busy_scaled;
int32_t core_busy, turbo_pstate, current_pstate; int32_t core_busy, max_pstate, current_pstate;
core_busy = int_tofp(cpu->samples[cpu->sample_ptr].core_pct_busy); core_busy = int_tofp(cpu->samples[cpu->sample_ptr].core_pct_busy);
turbo_pstate = int_tofp(cpu->pstate.turbo_pstate); max_pstate = int_tofp(cpu->pstate.max_pstate);
current_pstate = int_tofp(cpu->pstate.current_pstate); current_pstate = int_tofp(cpu->pstate.current_pstate);
busy_scaled = mul_fp(core_busy, div_fp(turbo_pstate, current_pstate)); busy_scaled = mul_fp(core_busy, div_fp(max_pstate, current_pstate));
return fp_toint(busy_scaled); return fp_toint(busy_scaled);
} }
......
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