]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: intel_pstate: Fix intel_pstate_verify_policy()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 28 Feb 2017 23:11:05 +0000 (00:11 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 5 Mar 2017 23:06:05 +0000 (00:06 +0100)
commitf1f9de06c51384be9173603c69e5f9016153d27d
tree8c0e1f15cc78e50e792b35e135346ffbd1d55714
parent37913a4ca93e35a0ecf970878edf75927493f68f
cpufreq: intel_pstate: Fix intel_pstate_verify_policy()

The code added to intel_pstate_verify_policy() by commit 3d95a3df743c
(cpufreq: intel_pstate: Fix sysfs limits enforcement for performance
policy) should use perf_limits instead of limits, because otherwise
setting global limits via sysfs may affect policies inconsistently.

For example, in the sequence of shell commands below, the
scaling_min_freq attribute for policy1 and policy2 should be
affected in the same way, because scaling_governor is set in
the same way for both of them:

 # cat cpufreq/policy1/scaling_governor
 powersave
 # cat cpufreq/policy2/scaling_governor
 powersave
 # echo performance > cpufreq/policy0/scaling_governor
 # echo 94 > intel_pstate/min_perf_pct
 # cat cpufreq/policy0/scaling_min_freq
 2914000
 # cat cpufreq/policy1/scaling_min_freq
 2914000
 # cat cpufreq/policy2/scaling_min_freq
 800000

The are affected differently, because intel_pstate_verify_policy()
is invoked with limits set to &performance_limits (left behind by
policy0) for policy1 and with limits set to &powersave_limits (left
behind by policy1) for policy2.  Since perf_limits is set to the
set of limits matching the policy being updated, using it instead
of limits fixes the inconsistency.

Fixes: 3d95a3df743c (cpufreq: intel_pstate: Fix sysfs limits enforcement for performance policy)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/intel_pstate.c