diff options
| author | Dhananjay Ugwekar <[email protected]> | 2025-01-29 08:05:14 +0000 |
|---|---|---|
| committer | Peter Zijlstra <[email protected]> | 2025-02-08 14:47:25 +0000 |
| commit | 469c76a83bb9f6b2c7b2989c46617c4fe01fee79 (patch) | |
| tree | 39c774334fda0c5dff7105c3f557f87116d6d6cc /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |
| parent | Linux 6.14-rc1 (diff) | |
| download | kernel-469c76a83bb9f6b2c7b2989c46617c4fe01fee79.tar.gz kernel-469c76a83bb9f6b2c7b2989c46617c4fe01fee79.zip | |
perf/x86/rapl: Fix the error checking order
After the commit b4943b8bfc41 ("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: b4943b8bfc41 ("perf/x86/rapl: Add core energy counter support for AMD CPUs")
Reported-by: Koichiro Den <[email protected]>
Signed-off-by: Dhananjay Ugwekar <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
0 files changed, 0 insertions, 0 deletions
