]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drivers/perf: riscv: Align errno for unsupported perf event
authorPu Lehui <pulehui@huawei.com>
Sat, 31 Aug 2024 07:15:20 +0000 (07:15 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2024 10:03:59 +0000 (12:03 +0200)
commita039aeba452db908e9e72d763227d8d695ff6614
tree8904e462bef63b35fada425691297ed7f3b0273e
parentd3f924c82e426a525f1c7315b35ad030d687a006
drivers/perf: riscv: Align errno for unsupported perf event

commit c625154993d0d24a962b1830cd5ed92adda2cf86 upstream.

RISC-V perf driver does not yet support PERF_TYPE_BREAKPOINT. It would
be more appropriate to return -EOPNOTSUPP or -ENOENT for this type in
pmu_sbi_event_map. Considering that other implementations return -ENOENT
for unsupported perf types, let's synchronize this behavior. Due to this
reason, a riscv bpf testcases perf_skip fail. Meanwhile, align that
behavior to the rest of proper place.

Signed-off-by: Pu Lehui <pulehui@huawei.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Fixes: 9b3e150e310e ("RISC-V: Add a simple platform driver for RISC-V legacy perf")
Fixes: 16d3b1af0944 ("perf: RISC-V: Check standard event availability")
Fixes: e9991434596f ("RISC-V: Add perf platform driver based on SBI PMU extension")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20240831071520.1630360-1-pulehui@huaweicloud.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/perf/riscv_pmu_legacy.c
drivers/perf/riscv_pmu_sbi.c