lib: sbi_pmu: Before using we should ensure PMU init done
If trap earlier before sbi_pmu_init done, some path would call sbi_pmu_ctr_incr_fw, then it would go wrong: 1. if phs_ptr_offset is zero, then it get a wrong pmu state ptr 2. if phs_ptr_offset is ok, but we didn't call pmu_set_hart_state_ptr it would be NULL POINT Of course, the above situation will not occur at present, but it is reasonable to check before using. Signed-off-by:yang.zhang <yang.zhang@hexintek.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
parent
46c8c658
Please register or sign in to comment