]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: intel_pstate: Fix limits->max_perf rounding error
authorPrarit Bhargava <prarit@redhat.com>
Fri, 20 Nov 2015 23:47:57 +0000 (18:47 -0500)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 23 Nov 2015 22:15:34 +0000 (23:15 +0100)
commit98e41e693fb2dabb58f751fbf7d1db77dcc3a67b
treeed0391d210f43f3d1d3e73a3f7e5e636a473c54a
parent94a721d86a1e6b6d6e9db3382bd6c46a225ec744
cpufreq: intel_pstate: Fix limits->max_perf rounding error

A rounding error was found in the calculation of limits->max_perf
in intel_pstate_set_policy(), which is used to calculate the max and min
pstate values in intel_pstate_get_min_max().  In that code,
limits->max_perf is truncated to 2 hex digits such that, for example,
0x169 was incorrectly calculated to 0x16 instead of 0x17.  This resulted in
the pstate being set one level too low.  This patch rounds the value of
limits->max_perf up instead of down so that the correct max pstate can
be reached.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/intel_pstate.c