Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c9d80dd authored by David S. Miller's avatar David S. Miller
Browse files

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: default avatarDavid S. Miller <davem@davemloft.net>
parent 88b938e6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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... */