Thread (7 messages) flat view 7 messages, 4 authors, 2007-03-11

Re: netconsole system freeze when cable unplugged

From: Francois Romieu <romieu@fr.zoreil.com>
Date: 2007-03-09 20:43:21
Also in: lkml
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Simon Arlott [off-list ref] :
When I unplug the cable the system just stops responding to anything, 
at all. No message is printed to the console when the cable is plugged 
back in.
rtl8139_interrupt (spin_lock(&tp->lock))
-> rtl8139_weird_interrupt
   -> rtl_check_media
      -> mii_check_media (printk(KERN_INFO "%s: link down\n", ...))
         [netpoll stuff here]
         -> rtl8139_poll_controller
            -> rtl8139_interrupt
               *deadlock*

See below for my random stuff of the day. Feel free to open a PR at
bugzilla.kernel.org if the issue does not go away.

--------8<-----------------------------------------------------------------

8139too: netconsole breakage when link changes

rtl8139_interrupt is not supposed to be reentrant but its link
management part can emit printk.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index 99304b2..64467ad 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -2215,9 +2215,16 @@ static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance)
  */
 static void rtl8139_poll_controller(struct net_device *dev)
 {
-	disable_irq(dev->irq);
+	struct rtl8139_private *tp = netdev_priv(dev);
+	unsigned long flags;
+	int rc;
+
+	rc = spin_trylock_irqsave(&tp->lock, flags);
+	if (!rc)
+		return;
+	spin_unlock(&tp->lock);
 	rtl8139_interrupt(dev->irq, dev);
-	enable_irq(dev->irq);
+	local_irq_restore(flags);
 }
 #endif
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help