summaryrefslogtreecommitdiffstats
path: root/drivers/perf/riscv_pmu.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 18:43:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 18:43:43 +0000
commit707f12e5cf5fccb32d14e8c03a18c07699724b4c (patch)
treeab06af4c94044b98ba14a10ba2477df29567be47 /drivers/perf/riscv_pmu.c
parentReleasing progress-linux version 6.7.7-1~progress7.99u1. (diff)
downloadlinux-707f12e5cf5fccb32d14e8c03a18c07699724b4c.tar.xz
linux-707f12e5cf5fccb32d14e8c03a18c07699724b4c.zip
Merging upstream version 6.7.9.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/perf/riscv_pmu.c')
-rw-r--r--drivers/perf/riscv_pmu.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/perf/riscv_pmu.c b/drivers/perf/riscv_pmu.c
index 0dda70e1e..c78a6fd6c 100644
--- a/drivers/perf/riscv_pmu.c
+++ b/drivers/perf/riscv_pmu.c
@@ -150,19 +150,11 @@ u64 riscv_pmu_ctr_get_width_mask(struct perf_event *event)
struct riscv_pmu *rvpmu = to_riscv_pmu(event->pmu);
struct hw_perf_event *hwc = &event->hw;
- if (!rvpmu->ctr_get_width)
- /**
- * If the pmu driver doesn't support counter width, set it to default
- * maximum allowed by the specification.
- */
- cwidth = 63;
- else {
- if (hwc->idx == -1)
- /* Handle init case where idx is not initialized yet */
- cwidth = rvpmu->ctr_get_width(0);
- else
- cwidth = rvpmu->ctr_get_width(hwc->idx);
- }
+ if (hwc->idx == -1)
+ /* Handle init case where idx is not initialized yet */
+ cwidth = rvpmu->ctr_get_width(0);
+ else
+ cwidth = rvpmu->ctr_get_width(hwc->idx);
return GENMASK_ULL(cwidth, 0);
}