aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-08-09 19:08:56 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-08-09 19:08:56 -0400
commita891283e56362543d1d276e192266069ef52075b (patch)
tree014a666f8572605b2b90cecf8949679a714ff6e1
parent3714c281c679e3fd34944e6321ccc814d76c6c62 (diff)
cpufreq: intel_pstate: Simplify intel_pstate_adjust_pstate()
Since there is only one P-state selection routine in intel_pstate now, make intel_pstate_adjust_pstate() call it directly and drop the target_pstate argument from that function. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/cpufreq/intel_pstate.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 942cd6888b54..e519940fa57c 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1495,13 +1495,15 @@ static void intel_pstate_update_pstate(struct cpudata *cpu, int pstate)
1495 wrmsrl(MSR_IA32_PERF_CTL, pstate_funcs.get_val(cpu, pstate)); 1495 wrmsrl(MSR_IA32_PERF_CTL, pstate_funcs.get_val(cpu, pstate));
1496} 1496}
1497 1497
1498static void intel_pstate_adjust_pstate(struct cpudata *cpu, int target_pstate) 1498static void intel_pstate_adjust_pstate(struct cpudata *cpu)
1499{ 1499{
1500 int from = cpu->pstate.current_pstate; 1500 int from = cpu->pstate.current_pstate;
1501 struct sample *sample; 1501 struct sample *sample;
1502 int target_pstate;
1502 1503
1503 update_turbo_state(); 1504 update_turbo_state();
1504 1505
1506 target_pstate = get_target_pstate_use_cpu_load(cpu);
1505 target_pstate = intel_pstate_prepare_request(cpu, target_pstate); 1507 target_pstate = intel_pstate_prepare_request(cpu, target_pstate);
1506 trace_cpu_frequency(target_pstate * cpu->pstate.scaling, cpu->cpu); 1508 trace_cpu_frequency(target_pstate * cpu->pstate.scaling, cpu->cpu);
1507 intel_pstate_update_pstate(cpu, target_pstate); 1509 intel_pstate_update_pstate(cpu, target_pstate);
@@ -1547,12 +1549,8 @@ static void intel_pstate_update_util(struct update_util_data *data, u64 time,
1547 return; 1549 return;
1548 1550
1549set_pstate: 1551set_pstate:
1550 if (intel_pstate_sample(cpu, time)) { 1552 if (intel_pstate_sample(cpu, time))
1551 int target_pstate; 1553 intel_pstate_adjust_pstate(cpu);
1552
1553 target_pstate = get_target_pstate_use_cpu_load(cpu);
1554 intel_pstate_adjust_pstate(cpu, target_pstate);
1555 }
1556} 1554}
1557 1555
1558static struct pstate_funcs core_funcs = { 1556static struct pstate_funcs core_funcs = {