Skip to content
  • Suzuki K Poulose's avatar
    arm-cci: Delay PMU counter writes to pmu::pmu_enable · c66eea5f
    Suzuki K Poulose authored
    
    
    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: 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>
    c66eea5f