aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-11-08 20:41:20 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-08 20:41:20 -0500
commit1c9d80ddc60f8ac26344ec3db9830e5f8016c16d (patch)
treee62ce00ce44b61e378af4aefa68ce7f9acdf9e23
parent88b938e63e68fd35e603421f722be0f35dde1016 (diff)
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>
-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
79 79
80 err = -ENODEV; 80 err = -ENODEV;
81 81
82 mutex_lock(&of_set_property_mutex);
82 write_lock(&devtree_lock); 83 write_lock(&devtree_lock);
83 prevp = &dp->properties; 84 prevp = &dp->properties;
84 while (*prevp) { 85 while (*prevp) {
@@ -88,9 +89,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
88 void *old_val = prop->value; 89 void *old_val = prop->value;
89 int ret; 90 int ret;
90 91
91 mutex_lock(&of_set_property_mutex);
92 ret = prom_setprop(dp->node, name, val, len); 92 ret = prom_setprop(dp->node, name, val, len);
93 mutex_unlock(&of_set_property_mutex);
94 93
95 err = -EINVAL; 94 err = -EINVAL;
96 if (ret >= 0) { 95 if (ret >= 0) {
@@ -109,6 +108,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
109 prevp = &(*prevp)->next; 108 prevp = &(*prevp)->next;
110 } 109 }
111 write_unlock(&devtree_lock); 110 write_unlock(&devtree_lock);
111 mutex_unlock(&of_set_property_mutex);
112 112
113 /* XXX Upate procfs if necessary... */ 113 /* XXX Upate procfs if necessary... */
114 114