Files
opensbi/lib/sbi
Fengwei Tan 827f8bf26b lib: sbi_pmu: fix mapping reset for already stopped counters
Linux stops a counter before issuing another stop with RESET flag when
deleting an event [1]. Returning early on SBI_EALREADY_STOPPED skips
counter-to-event mapping reset, eventually exhausting the hardware
counters.

Continue the stop and reset process for the remaining counters when a
counter in the set is already stopped. Preserve SBI_EALREADY_STOPPED in
the final result, while still returning immediately on other errors.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/perf/riscv_pmu.c?id=72d3fcf802c45d00b300f25b848a93c3a2bd7c7e#n318

Fixes: c5077d497d ("lib: sbi_pmu: Fix counter and event info error codes as per SBI v3.0 spec")
Signed-off-by: Fengwei Tan <tfx2001@outlook.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/SY8P300MB00410B44E7D55CB5CF7B276AB5882@SY8P300MB0041.AUSP300.PROD.OUTLOOK.COM
Signed-off-by: Anup Patel <anup@brainfault.org>
2026-11-02 12:02:17 +05:30
..
2020-03-11 15:29:45 +05:30
2026-09-16 09:48:30 +05:30
2026-09-16 09:48:30 +05:30
2026-09-16 09:48:30 +05:30
2026-06-12 11:58:35 +05:30