[etherlab-dev] system crash when ethernet cable disconnected

Zarges, Olav Olav.Zarges at imc-berlin.de
Wed Jul 16 18:02:05 CEST 2008


Hi,

the system the ethercat master runs on crashed when I disconnect
the ethernet cable. The dump shows that 'e1000_xmit_frame' is involed.

Looking into the code I found 'spin_unlock_irqrestore' is called directly
while at other occurences it is enclosed in

     if (!adapter->ecdev) {
         ...
     }

preventing it to be called when running as an ethercat device.

Is it missing by accident? I added the lines above and it seems to work.


Best regards

Olav


Index: devices/e1000/e1000_main-2.6.20-ethercat.c
===================================================================
--- devices/e1000/e1000_main-2.6.20-ethercat.c    (revision 154)
+++ devices/e1000/e1000_main-2.6.20-ethercat.c    (working copy)
@@ -3446,7 +3446,9 @@
         /* need: count + 2 desc gap to keep tail from touching
          * head, otherwise try next time */
         if (unlikely(e1000_maybe_stop_tx(netdev, tx_ring, count + 2))) {
-               spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
+               if (!adapter->ecdev) {
+                       spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
+               }
                 return NETDEV_TX_BUSY;
         }




More information about the etherlab-dev mailing list