All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpufreq: intel_pstate: Fix processing for turbo activation ratio
@ 2016-04-23  2:53 Srinivas Pandruvada
  2016-04-25 13:48 ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: Srinivas Pandruvada @ 2016-04-23  2:53 UTC (permalink / raw)
  To: rjw; +Cc: linux-pm, Srinivas Pandruvada

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.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 drivers/cpufreq/intel_pstate.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 1b2767d..03f94c2 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -813,6 +813,10 @@ static int core_get_max_pstate(void)
 			if (err)
 				goto skip_tar;
 
+			/* For level 1 and 2, bits[23:16] contains ratio */
+			if (tdp_ctrl)
+				tdp_ratio >>= 16;
+			tdp_ratio &= 0xff; /* ratios are only 8 bits long */
 			if (tdp_ratio - 1 == tar) {
 				max_pstate = tar;
 				pr_debug("max_pstate=TAC %x\n", max_pstate);
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-25 21:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-23  2:53 [PATCH] cpufreq: intel_pstate: Fix processing for turbo activation ratio Srinivas Pandruvada
2016-04-25 13:48 ` Rafael J. Wysocki
2016-04-25 16:28   ` Srinivas Pandruvada
2016-04-25 21:44     ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.