Re: netconsole system freeze when cable unplugged

2007-03-10 Thread Andi Kleen
Simon Arlott [EMAIL PROTECTED] writes:

 On 09/03/07 20:42, Francois Romieu wrote:
  Simon Arlott [EMAIL PROTECTED] :
  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.
 
 The patch doesn't fix it, nothing changes. I'm not sure how this can
 be debugged if printk won't work...

earlyprintk can be called directly (early_printk()) and should
work. It won't log over the network of course.

-Andi
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: netconsole system freeze when cable unplugged

2007-03-10 Thread Simon Arlott

On 10/03/07 13:38, Andi Kleen wrote:

Simon Arlott [EMAIL PROTECTED] writes:


On 09/03/07 20:42, Francois Romieu wrote:

Simon Arlott [EMAIL PROTECTED] :

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.

The patch doesn't fix it, nothing changes. I'm not sure how this can
be debugged if printk won't work...


earlyprintk can be called directly (early_printk()) and should
work. It won't log over the network of course.


It also won't log over the serial console either :(
(but that's probably a good thing, it's slow enough to boot with tons 
of messages to the display because of netconsole and nfs).


rtl8139_interrupt
- spin_lock(tp-lock)
- rtl8139_weird_interrupt
  - rtl_check_media
 - mii_check_media
- printk(KERN_INFO %s: link down\n, ...)
   - wite_msg
  - local_irq_save
  - netpoll_send_udp
 - netpoll_send_skb
- local_irq_save
- dev-hard_start_xmit(..., ...)
rtl8139_start_xmit
- spin_lock_irqsave
  *deadlock*

--
Simon Arlott
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: netconsole system freeze when cable unplugged

2007-03-10 Thread Matt Mackall
On Fri, Mar 09, 2007 at 09:42:43PM +0100, Francois Romieu wrote:
 Simon Arlott [EMAIL PROTECTED] :
  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*

Probably the best thing that can be done here aside from moving
mii_check_media outside interrupt handling is to add
netpoll_plug/unplug(dev) methods that push work off to netpoll's queue
for drivers that have a netpoll recursion problem.

-- 
Mathematics is the supreme nostalgia of our time.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: netconsole system freeze when cable unplugged

2007-03-10 Thread Andi Kleen
On Sat, Mar 10, 2007 at 02:06:28PM +, Simon Arlott wrote:
 On 10/03/07 13:38, Andi Kleen wrote:
 Simon Arlott [EMAIL PROTECTED] writes:
 
 On 09/03/07 20:42, Francois Romieu wrote:
 Simon Arlott [EMAIL PROTECTED] :
 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.
 The patch doesn't fix it, nothing changes. I'm not sure how this can
 be debugged if printk won't work...
 
 earlyprintk can be called directly (early_printk()) and should
 work. It won't log over the network of course.
 
 It also won't log over the serial console either :(

It does, you just have to configure it properly.

earlyprintk=serial,ttySx,baud

-Andi
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: netconsole system freeze when cable unplugged

2007-03-09 Thread Francois Romieu
Simon Arlott [EMAIL PROTECTED] :
 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 [EMAIL PROTECTED]

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
 
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: netconsole system freeze when cable unplugged

2007-03-09 Thread Simon Arlott

On 09/03/07 20:42, Francois Romieu wrote:

Simon Arlott [EMAIL PROTECTED] :
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.


The patch doesn't fix it, nothing changes. I'm not sure how this can 
be debugged if printk won't work...



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 [EMAIL PROTECTED]

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
 
-

To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
Simon Arlott
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html