Merge tag 'irqchip-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm...
[sfrench/cifs-2.6.git] / arch / arm / kernel / perf_event_v6.c
index f64a6bfebcec23fc769fea4d4fff58fd0dfd896f..1ae99deeec5491ebddfd212acd8de384e8969d0f 100644 (file)
@@ -233,7 +233,7 @@ armv6_pmcr_counter_has_overflowed(unsigned long pmcr,
        return ret;
 }
 
-static inline u32 armv6pmu_read_counter(struct perf_event *event)
+static inline u64 armv6pmu_read_counter(struct perf_event *event)
 {
        struct hw_perf_event *hwc = &event->hw;
        int counter = hwc->idx;
@@ -251,7 +251,7 @@ static inline u32 armv6pmu_read_counter(struct perf_event *event)
        return value;
 }
 
-static inline void armv6pmu_write_counter(struct perf_event *event, u32 value)
+static inline void armv6pmu_write_counter(struct perf_event *event, u64 value)
 {
        struct hw_perf_event *hwc = &event->hw;
        int counter = hwc->idx;
@@ -411,6 +411,12 @@ armv6pmu_get_event_idx(struct pmu_hw_events *cpuc,
        }
 }
 
+static void armv6pmu_clear_event_idx(struct pmu_hw_events *cpuc,
+                                    struct perf_event *event)
+{
+       clear_bit(event->hw.idx, cpuc->used_mask);
+}
+
 static void armv6pmu_disable_event(struct perf_event *event)
 {
        unsigned long val, mask, evt, flags;
@@ -491,6 +497,7 @@ static void armv6pmu_init(struct arm_pmu *cpu_pmu)
        cpu_pmu->read_counter   = armv6pmu_read_counter;
        cpu_pmu->write_counter  = armv6pmu_write_counter;
        cpu_pmu->get_event_idx  = armv6pmu_get_event_idx;
+       cpu_pmu->clear_event_idx = armv6pmu_clear_event_idx;
        cpu_pmu->start          = armv6pmu_start;
        cpu_pmu->stop           = armv6pmu_stop;
        cpu_pmu->map_event      = armv6_map_event;
@@ -541,6 +548,7 @@ static int armv6mpcore_pmu_init(struct arm_pmu *cpu_pmu)
        cpu_pmu->read_counter   = armv6pmu_read_counter;
        cpu_pmu->write_counter  = armv6pmu_write_counter;
        cpu_pmu->get_event_idx  = armv6pmu_get_event_idx;
+       cpu_pmu->clear_event_idx = armv6pmu_clear_event_idx;
        cpu_pmu->start          = armv6pmu_start;
        cpu_pmu->stop           = armv6pmu_stop;
        cpu_pmu->map_event      = armv6mpcore_map_event;