aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/drivers/net/phy/swconfig.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-03-15 19:32:31 +0000
committerFelix Fietkau <nbd@openwrt.org>2012-03-15 19:32:31 +0000
commitb957208807c3deeb0fbbdc80c5589863e9db06bb (patch)
treebc49121fad305290b5f6390112c6a51a78c0c1c2 /target/linux/generic/files/drivers/net/phy/swconfig.c
parent404a4c1fcdf271a922090b804a3587b384347c1f (diff)
downloadupstream-b957208807c3deeb0fbbdc80c5589863e9db06bb.tar.gz
upstream-b957208807c3deeb0fbbdc80c5589863e9db06bb.tar.bz2
upstream-b957208807c3deeb0fbbdc80c5589863e9db06bb.zip
swconfig: use a mutex instead of a spinlock, many swconfig calls sleep
SVN-Revision: 30952
Diffstat (limited to 'target/linux/generic/files/drivers/net/phy/swconfig.c')
-rw-r--r--target/linux/generic/files/drivers/net/phy/swconfig.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/swconfig.c b/target/linux/generic/files/drivers/net/phy/swconfig.c
index 1baccb1ba3..e772c94481 100644
--- a/target/linux/generic/files/drivers/net/phy/swconfig.c
+++ b/target/linux/generic/files/drivers/net/phy/swconfig.c
@@ -353,7 +353,7 @@ swconfig_get_dev(struct genl_info *info)
break;
}
if (dev)
- spin_lock(&dev->lock);
+ mutex_lock(&dev->sw_mutex);
else
DPRINTF("device %d not found\n", id);
swconfig_unlock();
@@ -364,7 +364,7 @@ done:
static inline void
swconfig_put_dev(struct switch_dev *dev)
{
- spin_unlock(&dev->lock);
+ mutex_unlock(&dev->sw_mutex);
}
static int
@@ -962,7 +962,7 @@ register_switch(struct switch_dev *dev, struct net_device *netdev)
return -ENOMEM;
}
swconfig_defaults_init(dev);
- spin_lock_init(&dev->lock);
+ mutex_init(&dev->sw_mutex);
swconfig_lock();
dev->id = ++swdev_id;
@@ -1000,11 +1000,11 @@ unregister_switch(struct switch_dev *dev)
{
swconfig_destroy_led_trigger(dev);
kfree(dev->portbuf);
- spin_lock(&dev->lock);
+ mutex_lock(&dev->sw_mutex);
swconfig_lock();
list_del(&dev->dev_list);
swconfig_unlock();
- spin_unlock(&dev->lock);
+ mutex_unlock(&dev->sw_mutex);
}
EXPORT_SYMBOL_GPL(unregister_switch);