Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH] tools/power turbostat: Fix MSRs with CONFIG_MULTIUSER=n
@ 2025-06-14  2:20 Calvin Owens
  2025-06-16  1:30 ` Zhang, Rui
  0 siblings, 1 reply; 6+ messages in thread
From: Calvin Owens @ 2025-06-14  2:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-pm, Len Brown

Handle ENOSYS from cap_get_proc() in check_for_cap_sys_rawio(), so
turbostat can display temperatures when running on kernels compiled
without multiuser support.

Signed-off-by: Calvin Owens <calvin@wbinvd.org>
---
 tools/power/x86/turbostat/turbostat.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 925556b90770..f7d665913a52 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -6496,8 +6496,13 @@ int check_for_cap_sys_rawio(void)
 	int ret = 0;
 
 	caps = cap_get_proc();
-	if (caps == NULL)
+	if (caps == NULL) {
+		/* Support CONFIG_MULTIUSER=n */
+		if (errno == ENOSYS)
+			return 0;
+
 		return 1;
+	}
 
 	if (cap_get_flag(caps, CAP_SYS_RAWIO, CAP_EFFECTIVE, &cap_flag_value)) {
 		ret = 1;
-- 
2.47.2


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

end of thread, other threads:[~2025-06-18 14:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-14  2:20 [PATCH] tools/power turbostat: Fix MSRs with CONFIG_MULTIUSER=n Calvin Owens
2025-06-16  1:30 ` Zhang, Rui
2025-06-16  4:38   ` Calvin Owens
2025-06-16  4:44     ` Calvin Owens
2025-06-18  3:28     ` Zhang, Rui
2025-06-18 14:32       ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox