[openwrt/openwrt] swconfig: convert swdevs_lock from spinlock to mutex

LEDE Commits lede-commits at lists.infradead.org
Mon Mar 12 04:51:06 PDT 2018


nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/ed3860c3e3ebe484c00cf603c29e68af28eb0839

commit ed3860c3e3ebe484c00cf603c29e68af28eb0839
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Mon Mar 12 09:50:33 2018 +0100

    swconfig: convert swdevs_lock from spinlock to mutex
    
    Should fix some sleep-while-atomic issues
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/generic/files/drivers/net/phy/swconfig.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/swconfig.c b/target/linux/generic/files/drivers/net/phy/swconfig.c
index 78569a9..e8a6847 100644
--- a/target/linux/generic/files/drivers/net/phy/swconfig.c
+++ b/target/linux/generic/files/drivers/net/phy/swconfig.c
@@ -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 *



More information about the lede-commits mailing list