Skip to content

Commit 7dd646c

Browse files
SiFiveHollandpalmer-dabbelt
authored andcommitted
drivers/perf: riscv: Reset the counter to hpmevent mapping while starting cpus
Currently, we stop all the counters while a new cpu is brought online. However, the hpmevent to counter mappings are not reset. The firmware may have some stale encoding in their mapping structure which may lead to undesirable results. We have not encountered such scenario though. Signed-off-by: Samuel Holland <[email protected]> Signed-off-by: Atish Patra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent a3f24e8 commit 7dd646c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/perf/riscv_pmu_sbi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ static inline void pmu_sbi_stop_all(struct riscv_pmu *pmu)
762762
* which may include counters that are not enabled yet.
763763
*/
764764
sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_STOP,
765-
0, pmu->cmask, 0, 0, 0, 0);
765+
0, pmu->cmask, SBI_PMU_STOP_FLAG_RESET, 0, 0, 0);
766766
}
767767

768768
static inline void pmu_sbi_stop_hw_ctrs(struct riscv_pmu *pmu)

0 commit comments

Comments
 (0)