Skip to content

Commit 1becf03

Browse files
spandruvadarafaeljw
authored andcommitted
cpufreq: intel_pstate: Fix processing for turbo activation ratio
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: 6a35fc2 (cpufreq: intel_pstate: get P1 from TAR when available) Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: 4.4+ <stable@vger.kernel.org> # 4.4+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 94862a6 commit 1becf03

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,11 @@ static int core_get_max_pstate(void)
813813
if (err)
814814
goto skip_tar;
815815

816+
/* For level 1 and 2, bits[23:16] contain the ratio */
817+
if (tdp_ctrl)
818+
tdp_ratio >>= 16;
819+
820+
tdp_ratio &= 0xff; /* ratios are only 8 bits long */
816821
if (tdp_ratio - 1 == tar) {
817822
max_pstate = tar;
818823
pr_debug("max_pstate=TAC %x\n", max_pstate);

0 commit comments

Comments
 (0)