Perf: arm64: restore registers after reset

Reset will overwrite registers written by
restore_pm_registers, so order the calls correctly.

Change-Id: I8210d61c2f4c2397efb2de801d94ed1d5aad480c
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>
This commit is contained in:
Neil Leeder 2014-08-29 14:55:42 -04:00 committed by David Keitel
parent 09e03e5113
commit 6470f7956a
2 changed files with 4 additions and 2 deletions

View file

@ -31,6 +31,7 @@ static char *descriptions =
"10 Perf: arm64: tracectr: initialize counts after hotplug\n"
"11 Perf: arm64: Refine disable/enable in tracecounters\n"
"12 Perf: arm64: fix disable of pmu irq during hotplug\n"
"13 Perf: arm64: restore registers after reset\n"
"15 Perf: arm64: make debug dir handle exportable\n"
"16 Perf: arm64: add perf trace user\n"
"17 Perf: arm64: add support for kryo pmu\n"

View file

@ -858,15 +858,16 @@ static int perf_cpu_pm_notifier(struct notifier_block *self, unsigned long cmd,
case CPU_PM_ENTER_FAILED:
case CPU_PM_EXIT:
if (cpu_has_active_perf(cpu, cpu_pmu) && cpu_pmu->reset)
cpu_pmu->reset(NULL);
if (cpu_pmu->restore_pm_registers)
cpu_pmu->restore_pm_registers((void *)lcpu);
if (cpu_has_active_perf(cpu, cpu_pmu) && cpu_pmu->reset) {
if (cpu_has_active_perf(cpu, cpu_pmu)) {
/*
* Flip this bit so armpmu_enable knows it needs
* to re-enable active counters.
*/
get_cpu_var(from_idle) = 1;
cpu_pmu->reset(NULL);
pmu = &cpu_pmu->pmu;
pmu->pmu_enable(pmu);
}