From: Len Brown Date: Tue, 21 Apr 2026 21:26:33 +0000 (-0400) Subject: tools/power turbostat: Fix AMD RAPL regression on big systems X-Git-Tag: v7.1-rc1~4^2~9 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=3ae6bafa104d93ddc525b8de547bf66b43fcaf10;p=thirdparty%2Fkernel%2Flinux.git tools/power turbostat: Fix AMD RAPL regression on big systems turbostat.c:8688: rapl_perf_init: Assertion `next_domain < num_domains' failed. The initial fix for this regression was incomplete, as it did not handle multi-package systems with sparse core ids. Fixes: ef0e60083f76 ("tools/power turbostat: Fix AMD RAPL regression") Signed-off-by: Len Brown --- diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index e9e8ef72395a9..bea574d7aa68a 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -5155,7 +5155,7 @@ static inline int get_rapl_num_domains(void) if (!platform->has_per_core_rapl) return topo.num_packages; - return topo.num_cores; + return GLOBAL_CORE_ID(topo.max_core_id, topo.num_packages) + 1; } static inline int get_rapl_domain_id(int cpu)