]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
arm-cci: Delay PMU counter writes to pmu::pmu_enable
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Tue, 23 Feb 2016 10:49:47 +0000 (10:49 +0000)
committerWill Deacon <will.deacon@arm.com>
Mon, 29 Feb 2016 23:23:16 +0000 (23:23 +0000)
commitc66eea5f9f55f2ddf742670d35e4c9e30dc42a0a
treedf6dcaed6578f5e02f0e59392403d4923d1ed10e
parenta077c52f349fdeeccc3f9f3590d63fe2b116b9a5
arm-cci: Delay PMU counter writes to pmu::pmu_enable

CCI PMU driver always reprograms the counters to a safe value (half of the
counter max, = 2^31) before starting the profiling to account for extreme
interrupt latencies. Also, the cost of writing to a PMU counter could be
very costly on some PMUs(e.g, CCI-500). In order to ammortise the cost of
programming the counters, this patch delays the counter writes to pmu::pmu_enable().
We use the PER_HES_ARCH flag to keep track of the counters which need to
be programmed. Before turning on the PMU, we go through the counters that
were marked for write, and perform the operation in a batch.

To unify all the counter writes to pmu_enable(), this patch also makes sure that
we disable-and-enable the PMU in the irq handler to program any counters that
overflowed.

Cc: Punit Agrawal <punit.agrawal@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/bus/arm-cci.c