summaryrefslogtreecommitdiffstats
path: root/drivers/perf/arm_cspmu
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2024-02-06 11:27:56 +0100
committerWill Deacon <will@kernel.org>2024-02-09 18:34:35 +0100
commite7e8fa8e82afddb3c9ff56d6a7030558776c5b1c (patch)
tree411792954c60a9288acea58118175554c1ba4135 /drivers/perf/arm_cspmu
parentperf/arm_cspmu: Simplify attribute groups (diff)
downloadlinux-e7e8fa8e82afddb3c9ff56d6a7030558776c5b1c.tar.xz
linux-e7e8fa8e82afddb3c9ff56d6a7030558776c5b1c.zip
perf/arm_cspmu: Simplify counter reset
arm_cspmu_reset_counters() inherently also stops them since it is writing 0 to PMCR.E, so there should be no need to do that twice. Also tidy up the reset routine itself for consistency with the start and stop routines, and to be clear at first glance that it is simply writing a constant value. Reviewed-by: Ilkka Koskinen <ilkka@os.amperecomputing.com> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com> Link: https://lore.kernel.org/r/3105815327989f6bb7bb068994d0eb4096b4ef64.1706718007.git.robin.murphy@arm.com Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'drivers/perf/arm_cspmu')
-rw-r--r--drivers/perf/arm_cspmu/arm_cspmu.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/perf/arm_cspmu/arm_cspmu.c b/drivers/perf/arm_cspmu/arm_cspmu.c
index e87bf0f64f01..5919ef63c2a8 100644
--- a/drivers/perf/arm_cspmu/arm_cspmu.c
+++ b/drivers/perf/arm_cspmu/arm_cspmu.c
@@ -525,11 +525,7 @@ static int arm_cspmu_alloc_attr_groups(struct arm_cspmu *cspmu)
static inline void arm_cspmu_reset_counters(struct arm_cspmu *cspmu)
{
- u32 pmcr = 0;
-
- pmcr |= PMCR_P;
- pmcr |= PMCR_C;
- writel(pmcr, cspmu->base0 + PMCR);
+ writel(PMCR_C | PMCR_P, cspmu->base0 + PMCR);
}
static inline void arm_cspmu_start_counters(struct arm_cspmu *cspmu)
@@ -1187,7 +1183,6 @@ static int arm_cspmu_register_pmu(struct arm_cspmu *cspmu)
};
/* Hardware counter init */
- arm_cspmu_stop_counters(cspmu);
arm_cspmu_reset_counters(cspmu);
ret = perf_pmu_register(&cspmu->pmu, cspmu->name, -1);