summaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-11-08 17:41:20 -0800
committerDavid S. Miller <davem@davemloft.net>2009-11-08 17:41:20 -0800
commit1c9d80ddc60f8ac26344ec3db9830e5f8016c16d (patch)
treee62ce00ce44b61e378af4aefa68ce7f9acdf9e23 /arch/sparc/kernel
parent88b938e63e68fd35e603421f722be0f35dde1016 (diff)
downloadblackbird-op-linux-1c9d80ddc60f8ac26344ec3db9830e5f8016c16d.tar.gz
blackbird-op-linux-1c9d80ddc60f8ac26344ec3db9830e5f8016c16d.zip
sparc: Move of_set_property_mutex acquisition outside of devtree_lock grab.
Otherwise we try to sleep with preemption disabled, etc. Noticed by Thomas Gleixner. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r--arch/sparc/kernel/prom_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/sparc/kernel/prom_common.c b/arch/sparc/kernel/prom_common.c
index 138910c67206..d80a65d9e893 100644
--- a/arch/sparc/kernel/prom_common.c
+++ b/arch/sparc/kernel/prom_common.c
@@ -79,6 +79,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
err = -ENODEV;
+ mutex_lock(&of_set_property_mutex);
write_lock(&devtree_lock);
prevp = &dp->properties;
while (*prevp) {
@@ -88,9 +89,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
void *old_val = prop->value;
int ret;
- mutex_lock(&of_set_property_mutex);
ret = prom_setprop(dp->node, name, val, len);
- mutex_unlock(&of_set_property_mutex);
err = -EINVAL;
if (ret >= 0) {
@@ -109,6 +108,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
prevp = &(*prevp)->next;
}
write_unlock(&devtree_lock);
+ mutex_unlock(&of_set_property_mutex);
/* XXX Upate procfs if necessary... */
OpenPOWER on IntegriCloud