diff options
| author | Neil Leeder <nleeder@codeaurora.org> | 2014-08-29 14:30:57 -0400 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:58:11 -0700 |
| commit | 09e03e5113703a706c4c105f7293080c0ea1aef3 (patch) | |
| tree | 617cfe022da829d163a2e84a71fcee5a84aa3a7f /include/linux | |
| parent | 0e4ee435ac293483d156db59cabb14a8445f5979 (diff) | |
Perf: arm64: fix disable of pmu irq during hotplug
PMU irq is disabled when a cpu is hotplugged off
and perf is running. Using cpu_pmu->active_events
to determine if the pmu is running left a window
where it is decremented to 0 in hw_perf_event_destroy,
and then armpmu_release_hardware is called. If a cpu
is hotplugged off in this window it may not disable
its irq. Use a separate flag which is not cleared
until after the irq is released by all online cpus.
The variable needs to be tristate because of the possibility
of a cpu being hotplugged in during this window. In that
case it should not enable its irq when the pmu is being
shut down. Having the GOING_DOWN state allows correct
behavior for cpus both going down and coming up.
Change-Id: I934ba5dec34e681ce8defd7fa7e311b4a2a92c1a
Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
[satyap: merge conflict resolution and move changes in
arch/arm64/kernel/perf_event.c to drivers/perf/arm_pmu.c
to align with kernel 4.4]
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/perf/arm_pmu.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/perf/arm_pmu.h b/include/linux/perf/arm_pmu.h index 12456debc693..6ebc90027fb3 100644 --- a/include/linux/perf/arm_pmu.h +++ b/include/linux/perf/arm_pmu.h @@ -51,6 +51,12 @@ struct arm_pmu_platdata { }, \ } +enum arm_pmu_state { + ARM_PMU_STATE_OFF = 0, + ARM_PMU_STATE_GOING_DOWN, + ARM_PMU_STATE_RUNNING, +}; + /* The events for a given PMU register set. */ struct pmu_hw_events { /* @@ -103,6 +109,7 @@ struct arm_pmu { void (*free_irq)(struct arm_pmu *); int (*map_event)(struct perf_event *event); int num_events; + int pmu_state; int percpu_irq; atomic_t active_events; struct mutex reserve_mutex; |
