Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a53eb5c6 authored by Suzuki K Poulose's avatar Suzuki K Poulose Committed by Will Deacon
Browse files

arm-cci: Group writes to counter



Add a helper to group the writes to PMU counter, this will be
used to delay setting the event period to pmu::pmu_enable()

Cc: Punit Agrawal <punit.agrawal@arm.com>
Acked-by: default avatarOlof Johansson <olof@lixom.net>
Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
Signed-off-by: default avatarSuzuki K. Poulose <suzuki.poulose@arm.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 0f17380c
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -771,6 +771,21 @@ static void pmu_write_counter(struct perf_event *event, u32 value)
		pmu_write_register(cci_pmu, value, idx, CCI_PMU_CNTR);
}

static void __maybe_unused
pmu_write_counters(struct cci_pmu *cci_pmu, unsigned long *mask)
{
	int i;
	struct cci_pmu_hw_events *cci_hw = &cci_pmu->hw_events;

	for_each_set_bit(i, mask, cci_pmu->num_cntrs) {
		struct perf_event *event = cci_hw->events[i];

		if (WARN_ON(!event))
			continue;
		pmu_write_counter(event, local64_read(&event->hw.prev_count));
	}
}

static u64 pmu_event_update(struct perf_event *event)
{
	struct hw_perf_event *hwc = &event->hw;