perf: replace cpu_up/down with device_online/offline

The cpu_up/down calls do not update userspace cpu
online information accurately. Use the device_on/offline
API to correct this.

Change-Id: I97ab55f4f917bd9cbb31dd89785eecdbe4d2f9ca
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 2015-11-20 14:45:09 -05:00 committed by David Keitel
parent 1170e6d78b
commit 38dccacd2b

View file

@ -1164,7 +1164,9 @@ static __ref void reset_pmu_force(void)
for_each_possible_cpu(cpu) {
if (!cpu_online(cpu)) {
save_online_mask |= BIT(cpu);
ret = cpu_up(cpu);
lock_device_hotplug();
ret = device_online(get_cpu_device(cpu));
unlock_device_hotplug();
if (ret)
pr_err("Failed to bring up CPU: %d, ret: %d\n",
cpu, ret);
@ -1176,7 +1178,9 @@ static __ref void reset_pmu_force(void)
armpmu_release_hardware(cpu_pmu);
for_each_possible_cpu(cpu) {
if ((save_online_mask & BIT(cpu)) && cpu_online(cpu)) {
ret = cpu_down(cpu);
lock_device_hotplug();
ret = device_online(get_cpu_device(cpu));
unlock_device_hotplug();
if (ret)
pr_err("Failed to bring down CPU: %d, ret: %d\n",
cpu, ret);