Commit 88273fe1 authored by yang.zhang's avatar yang.zhang Committed by Anup Patel
Browse files

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: default avataryang.zhang <yang.zhang@hexintek.com>
Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
parent 46c8c658
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment