lib: pmu: check SSCOF before masking
authorNikita Shubin <n.shubin@yadro.com>
Wed, 8 Dec 2021 11:16:54 +0000 (14:16 +0300)
committerAnup Patel <anup@brainfault.org>
Sat, 11 Dec 2021 10:56:15 +0000 (16:26 +0530)
commit460041c816f1b174899a3bf1147ce5d2e95731f4
tree4d731c5d72db0eca6b4062439bdfd21373fac7f0
parent66fbcc03df0444bb6ce2286d3605cbc13b361cb1
lib: pmu: check SSCOF before masking

We should check if SSCOF extension is present,
before applying inhibit mask and clearing overflow,
otherwise undesirable value can be written
in MHPMEVENT_N CSR.

Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Xiang W <wxjstz@126.com>
lib/sbi/sbi_pmu.c