Commit a6d04071 authored by Srinivas Pandruvada's avatar Srinivas Pandruvada Committed by Greg Kroah-Hartman

cpufreq: intel_pstate: Fix processing for turbo activation ratio

commit 1becf035 upstream.

When the config TDP level is not nominal (level = 0), the MSR values for
reading level 1 and level 2 ratios contain power in low 14 bits and actual
ratio bits are at bits [23:16]. The current processing for level 1 and
level 2 is wrong as there is no shift done to get actual ratio.

Fixes: 6a35fc2d (cpufreq: intel_pstate: get P1 from TAR when available)
Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 048866b7
...@@ -673,6 +673,11 @@ static int core_get_max_pstate(void) ...@@ -673,6 +673,11 @@ static int core_get_max_pstate(void)
if (err) if (err)
goto skip_tar; goto skip_tar;
/* For level 1 and 2, bits[23:16] contain the ratio */
if (tdp_ctrl)
tdp_ratio >>= 16;
tdp_ratio &= 0xff; /* ratios are only 8 bits long */
if (tdp_ratio - 1 == tar) { if (tdp_ratio - 1 == tar) {
max_pstate = tar; max_pstate = tar;
pr_debug("max_pstate=TAC %x\n", max_pstate); pr_debug("max_pstate=TAC %x\n", max_pstate);
......
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