diff options
author | Sheetal Sahasrabudhe <sheetals@codeaurora.org> | 2014-08-14 10:51:43 -0400 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:48:17 -0700 |
commit | 30fac71896757adf1336020419f1f140437fb980 (patch) | |
tree | 7f1f5a39f12339078f0137b10cfd4fe9ef5218b1 /drivers | |
parent | 2c167c7786cae6e53af720b81bd6ccdf195a75ab (diff) |
Perf: arm64: Update PMU force reset
Bring all cores online before doing a force reset for PMU.
This is required in order to handle corner case related to
freeing of IRQs for offline cores.
Change-Id: I091d9039e6554099ff4dd80d4a69cabe8eff3138
Signed-off-by: Sheetal Sahasrabudhe <sheetals@codeaurora.org>
[satyap: trivial 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 'drivers')
-rw-r--r-- | drivers/perf/arm_pmu.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index 079ed4206d28..f0ad3b8b941c 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -928,12 +928,32 @@ out_free: } #ifdef CONFIG_PERF_EVENTS_RESET_PMU_DEBUGFS -static void reset_pmu_force(void) +static __ref void reset_pmu_force(void) { + int cpu, ret; + u32 save_online_mask = 0; + + for_each_possible_cpu(cpu) { + if (!cpu_online(cpu)) { + save_online_mask |= BIT(cpu); + ret = cpu_up(cpu); + if (ret) + pr_err("Failed to bring up CPU: %d, ret: %d\n", + cpu, ret); + } + } if (cpu_pmu && cpu_pmu->reset) on_each_cpu(cpu_pmu->reset, NULL, 1); if (cpu_pmu && cpu_pmu->plat_device) armpmu_release_hardware(cpu_pmu); + for_each_possible_cpu(cpu) { + if ((save_online_mask & BIT(cpu)) && cpu_online(cpu)) { + ret = cpu_down(cpu); + if (ret) + pr_err("Failed to bring down CPU: %d, ret: %d\n", + cpu, ret); + } + } } static int write_enabled_perfpmu_action(void *data, u64 val) |