1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/arch
Dhananjay Ugwekar 469c76a83b perf/x86/rapl: Fix the error checking order
After the commit b4943b8bfc ("perf/x86/rapl: Add core energy counter
support for AMD CPUs"), the default "perf record"/"perf top" command is
broken in systems where there isn't a PMU registered for type
PERF_TYPE_RAW.

This is due to the change in order of error checks in rapl_pmu_event_init()
Due to which we return -EINVAL instead of -ENOENT, when we reach here from
the fallback loop in perf_init_event().

Move the "PMU and event type match" back to the beginning of the function
so that we return -ENOENT early on.

Closes: https://lore.kernel.org/all/uv7mz6vew2bzgre5jdpmwldxljp5djzmuiksqdcdwipfm4zm7w@ribobcretidk/
Fixes: b4943b8bfc ("perf/x86/rapl: Add core energy counter support for AMD CPUs")
Reported-by: Koichiro Den <koichiro.den@canonical.com>
Signed-off-by: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20250129080513.30353-1-dhananjay.ugwekar@amd.com
2025-02-08 15:47:25 +01:00
..
alpha The various patchsets are summarized below. Plus of course many 2025-01-26 18:36:23 -08:00
arc Kbuild updates for v6.14 2025-01-31 12:07:07 -08:00
arm Summary: 2025-01-29 10:35:40 -08:00
arm64 Summary: 2025-01-29 10:35:40 -08:00
csky asm-generic: pgalloc: provide generic __pgd_{alloc,free} 2025-01-25 20:22:24 -08:00
hexagon hexagon: Fix unbalanced spinlock in die() 2025-01-30 18:46:06 -08:00
loongarch LoongArch changes for v6.14 2025-01-28 08:52:01 -08:00
m68k revert "xarray: port tests to kunit" 2025-02-01 03:53:28 -08:00
microblaze asm-generic: pgalloc: provide generic __pgd_{alloc,free} 2025-01-25 20:22:24 -08:00
mips Revert commit breaking sysv ipc for o32 ABI 2025-02-01 14:54:33 -08:00
nios2 asm-generic: pgalloc: provide generic __pgd_{alloc,free} 2025-01-25 20:22:24 -08:00
openrisc The various patchsets are summarized below. Plus of course many 2025-01-26 18:36:23 -08:00
parisc The various patchsets are summarized below. Plus of course many 2025-01-26 18:36:23 -08:00
powerpc 21 hotfixes. 8 are cc:stable and the remainder address post-6.13 issues. 2025-02-01 09:49:20 -08:00
riscv RISC-V Patches for the 6.14 Merge Window, Part 1 2025-01-31 15:13:25 -08:00
s390 Kbuild updates for v6.14 2025-01-31 12:07:07 -08:00
sh sh updates for v6.14 2025-02-02 10:40:27 -08:00
sparc Driver core and debugfs updates 2025-01-28 12:25:12 -08:00
um This pull request contains the following changes for UML: 2025-01-30 18:29:40 -08:00
x86 perf/x86/rapl: Fix the error checking order 2025-02-08 15:47:25 +01:00
xtensa Xtensa updates for v6.14 2025-01-27 08:16:33 -08:00
.gitignore
Kconfig m68k: Use kernel's generic muldi3 libgcc function 2024-12-09 13:29:17 +01:00