netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 8139cp dev->tx_timeout
@ 2007-06-27  8:11 Mika.Lansirinne
  2007-06-27  8:36 ` Jeff Garzik
  0 siblings, 1 reply; 13+ messages in thread
From: Mika.Lansirinne @ 2007-06-27  8:11 UTC (permalink / raw)
  To: netdev


Hello All,

We have been experimenting a couple of interface hangs with the 8139cp
driver. It appears that the tx buffer stops transmitting and never starts
up again in some yet unknown conditions. To be able to circumvent this we
implemented the missing dev->tx_timeout function which should reset the
interface and allow it work again.

The problem reoccurs quite seldom and we have yet to be able to confirm
that the attached patch helps the situation. We though that we should
submit the patch anyway for reviewing.

The patch is made against 2.6.21.5 kernel.

(please cc me in your answer)


diff -ru linux-2.6.21.5/drivers/net/8139cp.c linux-2.6.21.5_8139cp-tx_timeout/drivers/net/8139cp.c
--- linux-2.6.21.5/drivers/net/8139cp.c   2007-06-11 21:37:06.000000000 +0300
+++ linux-2.6.21.5_8139cp-tx_timeout/drivers/net/8139cp.c   2007-06-26 15:48:23.000000000 +0300
@@ -26,7 +26,6 @@

      TODO:
      * Test Tx checksumming thoroughly
-     * Implement dev->tx_timeout

      Low priority TODO:
      * Complete reset on PciErr
@@ -1233,6 +1232,30 @@
      return 0;
 }

+static void cp_tx_timeout(struct net_device *dev)
+{
+     struct cp_private *cp = netdev_priv(dev);
+     int rc;
+     unsigned long flags;
+
+        printk (KERN_WARNING "%s: Transmit timeout, status %2x %4x %4x %4x\n",
+                dev->name, cpr8(Cmd), cpr16(CpCmd),
+                cpr16(IntrStatus), cpr16(IntrMask));
+
+     spin_lock_irqsave(&cp->lock, flags);
+
+     cp_stop_hw(cp);
+     cp_clean_rings(cp);
+     rc = cp_init_rings(cp);
+     cp_start_hw(cp);
+
+     netif_wake_queue(dev);
+
+     spin_unlock_irqrestore(&cp->lock, flags);
+
+     return;
+}
+
 #ifdef BROKEN
 static int cp_change_mtu(struct net_device *dev, int new_mtu)
 {
@@ -1938,10 +1961,8 @@
      dev->change_mtu = cp_change_mtu;
 #endif
      dev->ethtool_ops = &cp_ethtool_ops;
-#if 0
      dev->tx_timeout = cp_tx_timeout;
      dev->watchdog_timeo = TX_TIMEOUT;
-#endif

 #if CP_VLAN_TAG_USED
      dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;



Best regards,

Mr. Mika Länsirinne
Sofware Specialist
Stonesoft Corporation
Itälahdenkatu 22 A, FIN-00210 Helsinki, Finland
Mobile. +358-40-749 2068
Mika.Lansirinne@stonesoft.com
http://www.stonesoft.com


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-07-17  1:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-27  8:11 [PATCH] 8139cp dev->tx_timeout Mika.Lansirinne
2007-06-27  8:36 ` Jeff Garzik
2007-06-27  9:49   ` Mika.Lansirinne
2007-06-27 10:27   ` [PATCH 2.6.21.5] 8139cp: dev->tx_timeout Mika.Lansirinne
2007-07-02 12:39     ` Jeff Garzik
2007-07-02 13:30       ` [PATCH 2.6.22-rc7] " Mika.Lansirinne
2007-07-10 16:42         ` Jeff Garzik
2007-07-13 15:26           ` Mika.Lansirinne
2007-07-13 21:04             ` Francois Romieu
2007-07-13 21:05             ` [PATCH 1/1] 8139cp: implement the missing dev->tx_timeout Francois Romieu
2007-07-16 22:30               ` Jeff Garzik
2007-07-17  1:24               ` Arnaldo Carvalho de Melo
2007-06-27 10:43   ` [PATCH] 8139cp dev->tx_timeout Jarek Poplawski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).