Advertisement
vliaskov

use lock_device_hotplug before checking cpu masks

Jul 3rd, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. drivers/xen/cpu_hotplug.c | 9 +++++----
  2. 1 file changed, 5 insertions(+), 4 deletions(-)
  3.  
  4. diff --git a/drivers/xen/cpu_hotplug.c b/drivers/xen/cpu_hotplug.c
  5. index 5676aef..43ef131 100644
  6. --- a/drivers/xen/cpu_hotplug.c
  7. +++ b/drivers/xen/cpu_hotplug.c
  8. @@ -10,19 +10,20 @@
  9.  
  10. static void enable_hotplug_cpu(int cpu)
  11. {
  12. + lock_device_hotplug();
  13. if (!cpu_present(cpu))
  14. xen_arch_register_cpu(cpu);
  15. + unlock_device_hotplug();
  16.  
  17. set_cpu_present(cpu, true);
  18. }
  19.  
  20. static void disable_hotplug_cpu(int cpu)
  21. {
  22. - if (cpu_online(cpu)) {
  23. - lock_device_hotplug();
  24. + lock_device_hotplug();
  25. + if (cpu_online(cpu))
  26. device_offline(get_cpu_device(cpu));
  27. - unlock_device_hotplug();
  28. - }
  29. + unlock_device_hotplug();
  30. if (cpu_present(cpu))
  31. xen_arch_unregister_cpu(cpu);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement