From 5c7e2c8334325e9e1e2e0541863812146efacb0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= Date: Fri, 10 Jan 2025 14:15:56 +0100 Subject: lib: sbi: pmu: add the PMU SSE event only if overflow IRQ is supported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the PMU SSE event only if an overflow irq bit is present. Signed-off-by: Clément Léger Reviewed-by: Samuel Holland Reviewed-by: Atish Patra --- lib/sbi/sbi_pmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sbi/sbi_pmu.c b/lib/sbi/sbi_pmu.c index 6e69a4d..40b898f 100644 --- a/lib/sbi/sbi_pmu.c +++ b/lib/sbi/sbi_pmu.c @@ -1165,7 +1165,8 @@ int sbi_pmu_init(struct sbi_scratch *scratch, bool cold_boot) total_ctrs = num_hw_ctrs + SBI_PMU_FW_CTR_MAX; - sbi_sse_add_event(SBI_SSE_EVENT_LOCAL_PMU, &pmu_sse_cb_ops); + if (sbi_pmu_irq_bit() >= 0) + sbi_sse_add_event(SBI_SSE_EVENT_LOCAL_PMU, &pmu_sse_cb_ops); } phs = pmu_get_hart_state_ptr(scratch); -- cgit v1.1