From: Doug Smythies <doug.smythies@gmail.com>
To: lenb@kernel.org
Cc: dsmythies@telus.net, linux-kernel@vger.kernel.org,
linux-pm@vger.kernel.org
Subject: [PATCH] tools/power/x86/turbostat: Fix TCC offset bit mask
Date: Sat, 16 Jan 2021 09:07:25 -0800 [thread overview]
Message-ID: <20210116170725.5245-1-dsmythies@telus.net> (raw)
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
next reply other threads:[~2021-01-16 17:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-16 17:07 Doug Smythies [this message]
2021-03-11 23:18 ` [PATCH] tools/power/x86/turbostat: Fix TCC offset bit mask 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210116170725.5245-1-dsmythies@telus.net \
--to=doug.smythies@gmail.com \
--cc=dsmythies@telus.net \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).