Skip to contentSkip to conversation

cxgb3 - avoid deadlock with mac watchdog

PATCH In review [email protected] 2 participants 2 messages Apr 10, 2007 – Apr 11, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 cxgb3 - avoid deadlock with mac watchdog

From: Divy Le Ray <[email protected]>

Fix a deadlock when the interface s configured down and the watchdog tack is sleeping on rtnl_lock.

---

 drivers/net/cxgb3/cxgb3_main.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/net/cxgb3/cxgb3_main.c +3 -1
index 26240fd..c6ebe25 100644
@@ -2119,7 +2119,9 @@ static void check_t3b2_mac(struct adapte
 {
 	int i;
 
-	rtnl_lock();                      /* synchronize with ifdown */
+	if (!rtnl_trylock())	/* synchronize with ifdown */
+		return;
+
 	for_each_port(adapter, i) {
 		struct net_device *dev = adapter->port[i];
 		struct port_info *p = netdev_priv(dev);
#1 lore raw
Quoted 15 lines · [email protected] wrote:

From: Divy Le Ray <[email protected]>

Fix a deadlock when the interface s configured down and the watchdog tack is sleeping on rtnl_lock.

---

 drivers/net/cxgb3/cxgb3_main.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/net/cxgb3/cxgb3_main.c +0 -0
index 26240fd..c6ebe25 100644

drivers/net/cxgb3/cxgb3_main.c static void check_t3b2_mac(struct adapte · line 2127

Quoted 10 lines
drivers/net/cxgb3/cxgb3_main.c +3 -1
@@ -2119,7 +2119,9 @@ static void check_t3b2_mac(struct adapte
 {
 	int i;
 
-	rtnl_lock();                      /* synchronize with ifdown */
+	if (!rtnl_trylock())	/* synchronize with ifdown */
+		return;
+
 	for_each_port(adapter, i) {
 		struct net_device *dev = adapter->port[i];
 		struct port_info *p = netdev_priv(dev);

applied 1-3