diff options
author | Toshi Kani <toshi.kani@hp.com> | 2013-09-25 17:08:27 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-09-30 13:55:51 -0400 |
commit | 6dedcca610c6d6189b4a54d32118d1654adb73d2 (patch) | |
tree | 981de5689216d41a594a1aea945fc48ab0fc888f /drivers/base | |
parent | 1cad5e9a3978d182aa9b0e909fb0379da5ba45af (diff) |
hotplug, powerpc, x86: Remove cpu_hotplug_driver_lock()
cpu_hotplug_driver_lock() serializes CPU online/offline operations
when ARCH_CPU_PROBE_RELEASE is set. This lock interface is no longer
necessary with the following reason:
- lock_device_hotplug() now protects CPU online/offline operations,
including the probe & release interfaces enabled by
ARCH_CPU_PROBE_RELEASE. The use of cpu_hotplug_driver_lock() is
redundant.
- cpu_hotplug_driver_lock() is only valid when ARCH_CPU_PROBE_RELEASE
is defined, which is misleading and is only enabled on powerpc.
This patch removes the cpu_hotplug_driver_lock() interface. As
a result, ARCH_CPU_PROBE_RELEASE only enables / disables the cpu
probe & release interface as intended. There is no functional change
in this patch.
Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Reviewed-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/cpu.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 51f5d7fe2f0b..f48370dfc908 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c | |||
@@ -44,13 +44,11 @@ static int __ref cpu_subsys_online(struct device *dev) | |||
44 | struct cpu *cpu = container_of(dev, struct cpu, dev); | 44 | struct cpu *cpu = container_of(dev, struct cpu, dev); |
45 | int cpuid = dev->id; | 45 | int cpuid = dev->id; |
46 | int from_nid, to_nid; | 46 | int from_nid, to_nid; |
47 | int ret = -ENODEV; | 47 | int ret; |
48 | |||
49 | cpu_hotplug_driver_lock(); | ||
50 | 48 | ||
51 | from_nid = cpu_to_node(cpuid); | 49 | from_nid = cpu_to_node(cpuid); |
52 | if (from_nid == NUMA_NO_NODE) | 50 | if (from_nid == NUMA_NO_NODE) |
53 | goto out; | 51 | return -ENODEV; |
54 | 52 | ||
55 | ret = cpu_up(cpuid); | 53 | ret = cpu_up(cpuid); |
56 | /* | 54 | /* |
@@ -61,19 +59,12 @@ static int __ref cpu_subsys_online(struct device *dev) | |||
61 | if (from_nid != to_nid) | 59 | if (from_nid != to_nid) |
62 | change_cpu_under_node(cpu, from_nid, to_nid); | 60 | change_cpu_under_node(cpu, from_nid, to_nid); |
63 | 61 | ||
64 | out: | ||
65 | cpu_hotplug_driver_unlock(); | ||
66 | return ret; | 62 | return ret; |
67 | } | 63 | } |
68 | 64 | ||
69 | static int cpu_subsys_offline(struct device *dev) | 65 | static int cpu_subsys_offline(struct device *dev) |
70 | { | 66 | { |
71 | int ret; | 67 | return cpu_down(dev->id); |
72 | |||
73 | cpu_hotplug_driver_lock(); | ||
74 | ret = cpu_down(dev->id); | ||
75 | cpu_hotplug_driver_unlock(); | ||
76 | return ret; | ||
77 | } | 68 | } |
78 | 69 | ||
79 | void unregister_cpu(struct cpu *cpu) | 70 | void unregister_cpu(struct cpu *cpu) |