From 0928ca21bcbdcc925e500b99a046e736d9792e5c Mon Sep 17 00:00:00 2001 From: Atish Patra Date: Wed, 4 Dec 2024 16:43:46 -0800 Subject: [PATCH] lib: sbi_pmu: Fix the sanity check condition for hw event map The hardware event map function invoked from platform code should exclude any raw events as there is a separate function for the raw events. Fixes: d8a483fc7fd0 ("lib: sbi_pmu: PMU raw event v2 support") Signed-off-by: Atish Patra Reviewed-by: Anup Patel --- lib/sbi/sbi_pmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sbi/sbi_pmu.c b/lib/sbi/sbi_pmu.c index 0696ab5e..dca52eb1 100644 --- a/lib/sbi/sbi_pmu.c +++ b/lib/sbi/sbi_pmu.c @@ -293,8 +293,8 @@ reset_event: */ int sbi_pmu_add_hw_event_counter_map(u32 eidx_start, u32 eidx_end, u32 cmap) { - if ((eidx_start > eidx_end) || eidx_start >= SBI_PMU_EVENT_RAW_V2_IDX || - eidx_end >= SBI_PMU_EVENT_RAW_V2_IDX) + if ((eidx_start > eidx_end) || eidx_start >= SBI_PMU_EVENT_RAW_IDX || + eidx_end >= SBI_PMU_EVENT_RAW_IDX) return SBI_EINVAL; return pmu_add_hw_event_map(eidx_start, eidx_end, cmap, 0, 0);