tools/power/x86/turbostat: Fix TCC offset bit mask
diff mbox series

Message ID 20210116170725.5245-1-dsmythies@telus.net
State New, archived
Headers show
Series
  • tools/power/x86/turbostat: Fix TCC offset bit mask
Related show

Commit Message

Doug Smythies Jan. 16, 2021, 5:07 p.m. UTC
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(-)

Patch
diff mbox series

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;