All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/power/x86/turbostat: Fix TCC offset bit mask
@ 2021-01-16 17:07 Doug Smythies
  2021-03-11 23:18 ` Len Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Doug Smythies @ 2021-01-16 17:07 UTC (permalink / raw)
  To: lenb; +Cc: dsmythies, linux-kernel, linux-pm

The TCC offset mask is incorrect, resulting in
incorrect target temperature calculations, if
the offset is big enough to exceed the mask size.

Signed-off-by: Doug Smythies <dsmythies@telus.net>
---
 tools/power/x86/turbostat/turbostat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 389ea5209a83..d7acdd4d16c4 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -4823,7 +4823,7 @@ int read_tcc_activation_temp()
 
 	target_c = (msr >> 16) & 0xFF;
 
-	offset_c = (msr >> 24) & 0xF;
+	offset_c = (msr >> 24) & 0x3F;
 
 	tcc = target_c - offset_c;
 
-- 
2.25.1


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

end of thread, other threads:[~2021-04-11 14:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-16 17:07 [PATCH] tools/power/x86/turbostat: Fix TCC offset bit mask Doug Smythies
2021-03-11 23:18 ` Len Brown
2021-03-12  6:26   ` Doug Smythies
2021-03-12 22:15     ` Len Brown
2021-03-13 15:16       ` Doug Smythies
2021-04-11 14:09         ` Zhang Rui

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.