swconfig: convert swdevs_lock from spinlock to mutex
authorFelix Fietkau <nbd@nbd.name>
Mon, 12 Mar 2018 08:50:33 +0000 (09:50 +0100)
committerFelix Fietkau <nbd@nbd.name>
Mon, 12 Mar 2018 11:50:46 +0000 (12:50 +0100)
Should fix some sleep-while-atomic issues

Signed-off-by: Felix Fietkau <nbd@nbd.name>
target/linux/generic/files/drivers/net/phy/swconfig.c

index 78569a93025a7eb1fed18425ac12d88c763141ad..e8a684742cac8a561988cb6c6ce693b064f08ad7 100644 (file)
@@ -36,7 +36,7 @@ MODULE_LICENSE("GPL");
 
 static int swdev_id;
 static struct list_head swdevs;
-static DEFINE_SPINLOCK(swdevs_lock);
+static DEFINE_MUTEX(swdevs_lock);
 struct swconfig_callback;
 
 struct swconfig_callback {
@@ -296,13 +296,13 @@ static struct nla_policy link_policy[SWITCH_LINK_ATTR_MAX] = {
 static inline void
 swconfig_lock(void)
 {
-       spin_lock(&swdevs_lock);
+       mutex_lock(&swdevs_lock);
 }
 
 static inline void
 swconfig_unlock(void)
 {
-       spin_unlock(&swdevs_lock);
+       mutex_unlock(&swdevs_lock);
 }
 
 static struct switch_dev *