lib: sbi: Fix Priv spec version for [m|s]counteren and mcountinhibit CSRs
authorLey Foon Tan <leyfoon.tan@starfivetech.com>
Thu, 6 Jul 2023 06:30:28 +0000 (14:30 +0800)
committerAnup Patel <anup@brainfault.org>
Sun, 9 Jul 2023 05:38:35 +0000 (11:08 +0530)
Fix Priv spec version typo in commit d4b563c881d6 ("lib: sbi: Remove MCOUNTEREN
and SCOUNTEREN hart features").

At least Priv spec v1.11 is required for [m|s]counteren and mcountinhibit CSRs.

Fixes: d4b563c881d6 ("lib: sbi: Remove MCOUNTEREN and SCOUNTEREN hart features")
Signed-off-by: Ley Foon Tan <leyfoon.tan@starfivetech.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
lib/sbi/sbi_hart.c

index e9b2b271b8a33932f6ad0d1516b99c1ad903cdb6..0c27fd7ba010f3c931c0004ec72274cc13c5e723 100644 (file)
@@ -667,7 +667,7 @@ __mhpm_skip:
                hfeatures->priv_version = SBI_HART_PRIV_VER_1_12;
 
        /* Counter overflow/filtering is not useful without mcounter/inhibit */
-       if (hfeatures->priv_version >= SBI_HART_PRIV_VER_1_12) {
+       if (hfeatures->priv_version >= SBI_HART_PRIV_VER_1_11) {
                /* Detect if hart supports sscofpmf */
                csr_read_allowed(CSR_SCOUNTOVF, (unsigned long)&trap);
                if (!trap.cause)