Skip to content

Commit 8c28241

Browse files
ilkka-koskinenwilldeacon
authored andcommitted
perf: arm_cspmu: Split 64-bit write to 32-bit writes
Split the 64-bit register accesses if 64-bit access is not supported by the PMU. Signed-off-by: Ilkka Koskinen <ilkka@os.amperecomputing.com> Reviewed-by: Besar Wicaksono <bwicaksono@nvidia.com> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com> Link: https://lore.kernel.org/r/20230913233941.9814-2-ilkka@os.amperecomputing.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent bfc653a commit 8c28241

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/perf/arm_cspmu/arm_cspmu.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,10 @@ static void arm_cspmu_write_counter(struct perf_event *event, u64 val)
719719
if (use_64b_counter_reg(cspmu)) {
720720
offset = counter_offset(sizeof(u64), event->hw.idx);
721721

722-
writeq(val, cspmu->base1 + offset);
722+
if (cspmu->has_atomic_dword)
723+
writeq(val, cspmu->base1 + offset);
724+
else
725+
lo_hi_writeq(val, cspmu->base1 + offset);
723726
} else {
724727
offset = counter_offset(sizeof(u32), event->hw.idx);
725728

0 commit comments

Comments
 (0)