diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-27 20:12:41 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-27 20:12:41 -0400 |
commit | 5c2aae8355f7ec1341d5c473c500a77bbfa7f701 (patch) | |
tree | bdb6059fbc1b476c36e7cda433fc4db64c627407 /drivers/base | |
parent | 3fbc4d63744b21ed6814ce768672531500bd3f14 (diff) | |
parent | 16ff816d3b5d2b81fcff5ca44eb9a98ac3b604b4 (diff) |
Merge branch 'acpi-hotplug'
* acpi-hotplug:
ACPI / memhotplug: Use defined marco METHOD_NAME__STA
ACPI / hotplug: Use kobject_init_and_add() instead of _init() and _add()
ACPI / hotplug: Don't set kobject parent pointer explicitly
ACPI / hotplug: Set kobject name via kobject_add(), not kobject_set_name()
hotplug, powerpc, x86: Remove cpu_hotplug_driver_lock()
hotplug / x86: Disable ARCH_CPU_PROBE_RELEASE on x86
hotplug / x86: Add hotplug lock to missing places
hotplug / x86: Fix online state in cpu0 debug interface
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/cpu.c | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 848ebbd25717..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) |
@@ -93,7 +84,17 @@ static ssize_t cpu_probe_store(struct device *dev, | |||
93 | const char *buf, | 84 | const char *buf, |
94 | size_t count) | 85 | size_t count) |
95 | { | 86 | { |
96 | return arch_cpu_probe(buf, count); | 87 | ssize_t cnt; |
88 | int ret; | ||
89 | |||
90 | ret = lock_device_hotplug_sysfs(); | ||
91 | if (ret) | ||
92 | return ret; | ||
93 | |||
94 | cnt = arch_cpu_probe(buf, count); | ||
95 | |||
96 | unlock_device_hotplug(); | ||
97 | return cnt; | ||
97 | } | 98 | } |
98 | 99 | ||
99 | static ssize_t cpu_release_store(struct device *dev, | 100 | static ssize_t cpu_release_store(struct device *dev, |
@@ -101,7 +102,17 @@ static ssize_t cpu_release_store(struct device *dev, | |||
101 | const char *buf, | 102 | const char *buf, |
102 | size_t count) | 103 | size_t count) |
103 | { | 104 | { |
104 | return arch_cpu_release(buf, count); | 105 | ssize_t cnt; |
106 | int ret; | ||
107 | |||
108 | ret = lock_device_hotplug_sysfs(); | ||
109 | if (ret) | ||
110 | return ret; | ||
111 | |||
112 | cnt = arch_cpu_release(buf, count); | ||
113 | |||
114 | unlock_device_hotplug(); | ||
115 | return cnt; | ||
105 | } | 116 | } |
106 | 117 | ||
107 | static DEVICE_ATTR(probe, S_IWUSR, NULL, cpu_probe_store); | 118 | static DEVICE_ATTR(probe, S_IWUSR, NULL, cpu_probe_store); |