diff options
| author | Samuel Holland <samuel.holland@sifive.com> | 2024-06-28 00:51:42 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-07-25 09:49:18 +0200 |
| commit | be3ba371437da22e6c6bab4a73824bf59cb68df5 (patch) | |
| tree | 3942e7f45e51f5610d354a3799b69a5aca1c2d58 /drivers | |
| parent | 2c9127b4cd8466428bbf9b4a45a34e146e7dcce9 (diff) | |
| download | linux-be3ba371437da22e6c6bab4a73824bf59cb68df5.tar.gz linux-be3ba371437da22e6c6bab4a73824bf59cb68df5.tar.bz2 linux-be3ba371437da22e6c6bab4a73824bf59cb68df5.zip | |
drivers/perf: riscv: Reset the counter to hpmevent mapping while starting cpus
[ Upstream commit 7dd646cf745c34d31e7ed2a52265e9ca8308f58f ]
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 <samuel.holland@sifive.com>
Signed-off-by: Atish Patra <atishp@rivosinc.com>
Link: https://lore.kernel.org/r/20240628-misc_perf_fixes-v4-2-e01cfddcf035@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/perf/riscv_pmu_sbi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c index 382fe5ee6100..5aab43a3ffb9 100644 --- a/drivers/perf/riscv_pmu_sbi.c +++ b/drivers/perf/riscv_pmu_sbi.c @@ -502,7 +502,7 @@ static inline void pmu_sbi_stop_all(struct riscv_pmu *pmu) * which may include counters that are not enabled yet. */ sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_STOP, - 0, pmu->cmask, 0, 0, 0, 0); + 0, pmu->cmask, SBI_PMU_STOP_FLAG_RESET, 0, 0, 0); } static inline void pmu_sbi_stop_hw_ctrs(struct riscv_pmu *pmu) |
