summaryrefslogtreecommitdiff
path: root/drivers/base/cpu.c
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2014-04-07 23:49:35 (GMT)
committerScott Wood <scottwood@freescale.com>2014-04-07 23:49:35 (GMT)
commit62b8c978ee6b8d135d9e7953221de58000dba986 (patch)
tree683b04b2e627f6710c22c151b23c8cc9a165315e /drivers/base/cpu.c
parent78fd82238d0e5716578c326404184a27ba67fd6e (diff)
downloadlinux-fsl-qoriq-62b8c978ee6b8d135d9e7953221de58000dba986.tar.xz
Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12
Diffstat (limited to 'drivers/base/cpu.c')
-rw-r--r--drivers/base/cpu.c39
1 files changed, 14 insertions, 25 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index f48370d..848ebbd 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -44,11 +44,13 @@ static int __ref cpu_subsys_online(struct device *dev)
struct cpu *cpu = container_of(dev, struct cpu, dev);
int cpuid = dev->id;
int from_nid, to_nid;
- int ret;
+ int ret = -ENODEV;
+
+ cpu_hotplug_driver_lock();
from_nid = cpu_to_node(cpuid);
if (from_nid == NUMA_NO_NODE)
- return -ENODEV;
+ goto out;
ret = cpu_up(cpuid);
/*
@@ -59,12 +61,19 @@ static int __ref cpu_subsys_online(struct device *dev)
if (from_nid != to_nid)
change_cpu_under_node(cpu, from_nid, to_nid);
+ out:
+ cpu_hotplug_driver_unlock();
return ret;
}
static int cpu_subsys_offline(struct device *dev)
{
- return cpu_down(dev->id);
+ int ret;
+
+ cpu_hotplug_driver_lock();
+ ret = cpu_down(dev->id);
+ cpu_hotplug_driver_unlock();
+ return ret;
}
void unregister_cpu(struct cpu *cpu)
@@ -84,17 +93,7 @@ static ssize_t cpu_probe_store(struct device *dev,
const char *buf,
size_t count)
{
- ssize_t cnt;
- int ret;
-
- ret = lock_device_hotplug_sysfs();
- if (ret)
- return ret;
-
- cnt = arch_cpu_probe(buf, count);
-
- unlock_device_hotplug();
- return cnt;
+ return arch_cpu_probe(buf, count);
}
static ssize_t cpu_release_store(struct device *dev,
@@ -102,17 +101,7 @@ static ssize_t cpu_release_store(struct device *dev,
const char *buf,
size_t count)
{
- ssize_t cnt;
- int ret;
-
- ret = lock_device_hotplug_sysfs();
- if (ret)
- return ret;
-
- cnt = arch_cpu_release(buf, count);
-
- unlock_device_hotplug();
- return cnt;
+ return arch_cpu_release(buf, count);
}
static DEVICE_ATTR(probe, S_IWUSR, NULL, cpu_probe_store);