cpufreq: intel_pstate: Skip unnecessary PID resets on init
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 27 Mar 2017 22:11:53 +0000 (00:11 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 28 Mar 2017 21:12:14 +0000 (23:12 +0200)
PID controller parameters only need to be initialized if the
get_target_pstate_use_performance() P-state selection routine
is going to be used.  It is not necessary to initialize them
otherwise, so don't do that.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/intel_pstate.c

index b631ab02f1700ef995569b895f06c98ca08609cf..ee61db93163c2243bcb22dff8dd2858a2a5c747b 100644 (file)
@@ -1911,12 +1911,12 @@ static int intel_pstate_init_cpu(unsigned int cpunum)
                        intel_pstate_disable_ee(cpunum);
 
                intel_pstate_hwp_enable(cpu);
+       } else if (pstate_funcs.get_target_pstate == get_target_pstate_use_performance) {
+               intel_pstate_pid_reset(cpu);
        }
 
        intel_pstate_get_cpu_pstates(cpu);
 
-       intel_pstate_pid_reset(cpu);
-
        pr_debug("controlling: cpu %d\n", cpunum);
 
        return 0;