netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [e100 2.5] ICH 10/H Tx hang fix
@ 2004-04-24  5:25 Scott Feldman
  2004-04-25  2:21 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Scott Feldman @ 2004-04-24  5:25 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, scott.feldman


* Need to carry forward this workaround from old e100 driver to
  avoid a Tx hang on ICH systems linked at 10/Half.  Workaround
  adds a stall before each Tx command queued by issuing a NOP
  command followed by 1us delay.  Yuck!  Otherwise HW locks hard.
  (Probably needed for eepro100 also ;-).

----------------


--- linux-2.5/drivers/net/e100.c	2004-04-20 15:52:24.000000000 -0700
+++ linux-2.5/drivers/net/e100.c.mod	2004-04-20 15:55:32.000000000 -0700
@@ -287,6 +287,7 @@ enum scb_cmd_hi {
 };

 enum scb_cmd_lo {
+	cuc_nop        = 0x00,
 	ruc_start      = 0x01,
 	ruc_load_base  = 0x06,
 	cuc_start      = 0x10,
@@ -514,10 +515,11 @@ struct nic {
 	/* End: frequently used values: keep adjacent for cache effect */

 	enum {
-		ich           = (1 << 0),
-		promiscuous   = (1 << 1),
-		multicast_all = (1 << 2),
-		wol_magic     = (1 << 3),
+		ich                = (1 << 0),
+		promiscuous        = (1 << 1),
+		multicast_all      = (1 << 2),
+		wol_magic          = (1 << 3),
+		ich_10h_workaround = (1 << 4),
 	} flags					____cacheline_aligned;

 	enum mac mac;
@@ -1225,6 +1227,12 @@ static void e100_watchdog(unsigned long
 		/* Issue a multicast command to workaround a 557 lock up */
 		e100_set_multicast_list(nic->netdev);

+	if(nic->flags & ich && cmd.speed==SPEED_10 && cmd.duplex==DUPLEX_HALF)
+		/* Need SW workaround for ICH[x] 10Mbps/half duplex Tx hang. */
+		nic->flags |= ich_10h_workaround;
+	else
+		nic->flags &= ~ich_10h_workaround;
+
 	mod_timer(&nic->watchdog, jiffies + E100_WATCHDOG_PERIOD);
 }

@@ -1244,7 +1252,17 @@ static inline void e100_xmit_prepare(str
 static int e100_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 {
 	struct nic *nic = netdev->priv;
-	int err = e100_exec_cb(nic, skb, e100_xmit_prepare);
+	int err;
+
+	if(nic->flags & ich_10h_workaround) {
+		/* SW workaround for ICH[x] 10Mbps/half duplex Tx hang.
+		   Issue a NOP command followed by a 1us delay before
+		   issuing the Tx command. */
+		e100_exec_cmd(nic, cuc_nop, 0);
+		udelay(1);
+	}
+
+	err = e100_exec_cb(nic, skb, e100_xmit_prepare);

 	switch(err) {
 	case -ENOSPC:

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

end of thread, other threads:[~2004-04-25  2:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-24  5:25 [e100 2.5] ICH 10/H Tx hang fix Scott Feldman
2004-04-25  2:21 ` Jeff Garzik

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).