From: Alexandre Ghiti Date: Wed, 2 Aug 2023 08:03:21 +0000 (+0200) Subject: riscv: Make legacy counter enum match the HW numbering X-Git-Tag: v6.6.7~2022^2~13^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e8b785e98abb0cc12edd4ba2d3ccad767ab8b68d;p=platform%2Fkernel%2Flinux-starfive.git riscv: Make legacy counter enum match the HW numbering RISCV_PMU_LEGACY_INSTRET used to be set to 1 whereas the offset of this hardware counter from CSR_CYCLE is actually 2: make this offset match the real hw offset so that we can directly expose those values to userspace. Signed-off-by: Alexandre Ghiti Reviewed-by: Andrew Jones Reviewed-by: Atish Patra --- diff --git a/drivers/perf/riscv_pmu_legacy.c b/drivers/perf/riscv_pmu_legacy.c index ca9e20b..6a000ab 100644 --- a/drivers/perf/riscv_pmu_legacy.c +++ b/drivers/perf/riscv_pmu_legacy.c @@ -13,7 +13,7 @@ #include #define RISCV_PMU_LEGACY_CYCLE 0 -#define RISCV_PMU_LEGACY_INSTRET 1 +#define RISCV_PMU_LEGACY_INSTRET 2 static bool pmu_init_done;