]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf/x86/intel/uncore: Fix uncore_die_to_cpu() for offline dies
authorZide Chen <zide.chen@intel.com>
Tue, 2 Jun 2026 14:49:07 +0000 (07:49 -0700)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 4 Jun 2026 09:38:37 +0000 (11:38 +0200)
commit2aa7dacf8a3d928303df9c770c1bd7f50d1f8f2a
tree019116bb3aaa57c351983201e8e595ea219e26fc
parentce044cfb7a365742b2e9229a4b70cf2a663d7270
perf/x86/intel/uncore: Fix uncore_die_to_cpu() for offline dies

If the die is offline when uncore_die_to_cpu() is called, it silently
returns 0, which is misleading.  Return -1 in this case to indicate
that all CPUs on the die are offline and the caller can take care of
it accordingly.

Opportunistically, replace -EPERM with -ENODEV, as -ENODEV is
the appropriate error when no CPUs are online across all dies.

Signed-off-by: Zide Chen <zide.chen@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Link: https://patch.msgid.link/20260602144908.263680-7-zide.chen@intel.com
arch/x86/events/intel/uncore.c
arch/x86/events/intel/uncore_snbep.c