diff options
author | Toshi Kani <toshi.kani@hp.com> | 2013-08-29 20:22:07 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-09-25 04:38:09 -0400 |
commit | 574b851e99923c884fee4e0d7cf7e7c3dc023ffa (patch) | |
tree | 7498d2dcbc4bd2e3bf03434461ca36d31790a087 /arch/x86/kernel/topology.c | |
parent | f6913f990273a1fbfc0ec501d4998faa4f1ebae6 (diff) |
hotplug / x86: Add hotplug lock to missing places
lock_device_hotplug[_sysfs]() serializes CPU & Memory online/offline
and hotplug operations. However, this lock is not held in the debug
interfaces below that initiate CPU online/offline operations.
- _debug_hotplug_cpu(), cpu0 hotplug test interface enabled by
CONFIG_DEBUG_HOTPLUG_CPU0.
- cpu_probe_store() and cpu_release_store(), cpu hotplug test interface
enabled by CONFIG_ARCH_CPU_PROBE_RELEASE.
This patch changes the above interfaces to hold lock_device_hotplug().
Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'arch/x86/kernel/topology.c')
-rw-r--r-- | arch/x86/kernel/topology.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c index 5823bbd668f4..a3f35ebb3b52 100644 --- a/arch/x86/kernel/topology.c +++ b/arch/x86/kernel/topology.c | |||
@@ -65,6 +65,7 @@ int __ref _debug_hotplug_cpu(int cpu, int action) | |||
65 | if (!cpu_is_hotpluggable(cpu)) | 65 | if (!cpu_is_hotpluggable(cpu)) |
66 | return -EINVAL; | 66 | return -EINVAL; |
67 | 67 | ||
68 | lock_device_hotplug(); | ||
68 | cpu_hotplug_driver_lock(); | 69 | cpu_hotplug_driver_lock(); |
69 | 70 | ||
70 | switch (action) { | 71 | switch (action) { |
@@ -91,6 +92,7 @@ int __ref _debug_hotplug_cpu(int cpu, int action) | |||
91 | } | 92 | } |
92 | 93 | ||
93 | cpu_hotplug_driver_unlock(); | 94 | cpu_hotplug_driver_unlock(); |
95 | unlock_device_hotplug(); | ||
94 | 96 | ||
95 | return ret; | 97 | return ret; |
96 | } | 98 | } |