summaryrefslogtreecommitdiff
path: root/scripts/kernel-doc
diff options
context:
space:
mode:
authorLeo Yan <leo.yan@arm.com>2026-02-03 17:40:43 +0300
committerWill Deacon <will@kernel.org>2026-02-03 22:41:50 +0300
commit283182c1c239f6873d1a50e9e710c1a699f2256b (patch)
treed2622c9c13a6464a21b936091947f2221abaae0e /scripts/kernel-doc
parent53c998527ffa60f9deda8974a11ad39790684159 (diff)
downloadlinux-283182c1c239f6873d1a50e9e710c1a699f2256b.tar.xz
perf: arm_spe: Properly set hw.state on failures
When arm_spe_pmu_next_off() fails to calculate a valid limit, it returns zero to indicate that tracing should not start. However, the caller arm_spe_perf_aux_output_begin() does not propagate this failure by updating hwc->state, cause the error to be silently ignored by upper layers. Because hwc->state remains zero after a failure, arm_spe_pmu_start() continues to programs filter registers unnecessarily. The driver still reports success to the perf core, so the core assumes the SPE event was enabled and proceeds to enable other events. This breaks event group semantics: SPE is already stopped while other events in the same group are enabled. Fix this by updating arm_spe_perf_aux_output_begin() to return a status code indicating success (0) or failure (-EIO). Both the interrupt handler and arm_spe_pmu_start() check the return value and call arm_spe_pmu_stop() to set PERF_HES_STOPPED in hwc->state. In the interrupt handler, the period (e.g., period_left) needs to be updated, so PERF_EF_UPDATE is passed to arm_spe_pmu_stop(). When the error occurs during event start, the trace unit is not yet enabled, so a flag '0' is used to drain buffer and update state only. Fixes: d5d9696b0380 ("drivers/perf: Add support for ARMv8.2 Statistical Profiling Extension") Signed-off-by: Leo Yan <leo.yan@arm.com> Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'scripts/kernel-doc')
0 files changed, 0 insertions, 0 deletions