aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2015-10-22 12:21:46 -0400
committerDavid Vrabel <david.vrabel@citrix.com>2015-10-23 09:20:48 -0400
commit1c7a62137bb23bc8a2c05d1dad6105afa569b20e (patch)
treea17571adf4865159b9319d0919757d1b9aed06ab
parenta314e3eb845389b8f68130c79a63832229dea87b (diff)
xen, cpu_hotplug: call device_offline instead of cpu_down
When offlining a cpu, instead of cpu_down, call device_offline, which also takes care of updating the cpu.dev.offline field. This keeps the sysfs file /sys/devices/system/cpu/cpuN/online, up to date. Also move the call to disable_hotplug_cpu, because it makes more sense to have it there. We don't call device_online at cpu-hotplug time, because that would immediately take the cpu online, while we want to retain the current behaviour: the user needs to explicitly enable the cpu after it has been hotplugged. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> CC: konrad.wilk@oracle.com CC: boris.ostrovsky@oracle.com CC: david.vrabel@citrix.com
-rw-r--r--drivers/xen/cpu_hotplug.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/xen/cpu_hotplug.c b/drivers/xen/cpu_hotplug.c
index 43de1f51b53f..5676aefdf2bc 100644
--- a/drivers/xen/cpu_hotplug.c
+++ b/drivers/xen/cpu_hotplug.c
@@ -18,6 +18,11 @@ static void enable_hotplug_cpu(int cpu)
18 18
19static void disable_hotplug_cpu(int cpu) 19static void disable_hotplug_cpu(int cpu)
20{ 20{
21 if (cpu_online(cpu)) {
22 lock_device_hotplug();
23 device_offline(get_cpu_device(cpu));
24 unlock_device_hotplug();
25 }
21 if (cpu_present(cpu)) 26 if (cpu_present(cpu))
22 xen_arch_unregister_cpu(cpu); 27 xen_arch_unregister_cpu(cpu);
23 28
@@ -55,7 +60,6 @@ static void vcpu_hotplug(unsigned int cpu)
55 enable_hotplug_cpu(cpu); 60 enable_hotplug_cpu(cpu);
56 break; 61 break;
57 case 0: 62 case 0:
58 (void)cpu_down(cpu);
59 disable_hotplug_cpu(cpu); 63 disable_hotplug_cpu(cpu);
60 break; 64 break;
61 default: 65 default: