patch-2.4.0-test3 linux/drivers/net/arcnet/arcnet.c

Next file: linux/drivers/net/arcnet/com90xx.c
Previous file: linux/drivers/net/appletalk/ltpc.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test2/linux/drivers/net/arcnet/arcnet.c linux/drivers/net/arcnet/arcnet.c
@@ -672,21 +672,20 @@
 	unsigned long flags;
 	struct arcnet_local *lp = (struct arcnet_local *) dev->priv;
 	int status = ASTATUS();
+	char *msg;
 
 	save_flags(flags);
 	cli();
 
 	if (status & TXFREEflag) {	/* transmit _DID_ finish */
-		BUGMSG(D_NORMAL, "tx timeout - missed IRQ? (status=%Xh, mask=%Xh, dest=%02Xh)\n",
-		       status, lp->intmask, lp->lasttrans_dest);
-		lp->stats.tx_errors++;
+		msg = " - missed IRQ?";
 	} else {
-		BUGMSG(D_EXTRA, "tx timed out (status=%Xh, intmask=%Xh, dest=%02Xh)\n",
-		       status, lp->intmask, lp->lasttrans_dest);
-		lp->stats.tx_errors++;
+		msg = "";
 		lp->stats.tx_aborted_errors++;
+		lp->timed_out = 1;
 		ACOMMAND(NOTXcmd | (lp->cur_tx << 3));
 	}
+	lp->stats.tx_errors++;
 
 	/* make sure we didn't miss a TX IRQ */
 	AINTMASK(0);
@@ -694,6 +693,12 @@
 	AINTMASK(lp->intmask);
 
 	restore_flags(flags);
+
+	if (jiffies - lp->last_timeout > 10*HZ) {
+		BUGMSG(D_EXTRA, "tx timed out%s (status=%Xh, intmask=%Xh, dest=%02Xh)\n",
+		       msg, status, lp->intmask, lp->lasttrans_dest);
+		lp->last_timeout = jiffies;
+	}
 }
 
 
@@ -778,12 +783,12 @@
 			didsomething++;
 		}
 		/* a transmit finished, and we're interested in it. */
-		if (status & lp->intmask & TXFREEflag) {
+		if ((status & lp->intmask & TXFREEflag) || lp->timed_out) {
 			lp->intmask &= ~TXFREEflag;
 
 			BUGMSG(D_DURING, "TX IRQ (stat=%Xh)\n", status);
 
-			if (lp->cur_tx != -1 && !(status & TXACKflag)) {
+			if (lp->cur_tx != -1 && !(status & TXACKflag) && !lp->timed_out) {
 				if (lp->lasttrans_dest != 0) {
 					BUGMSG(D_EXTRA, "transmit was not acknowledged! "
 					    "(status=%Xh, dest=%02Xh)\n",
@@ -801,6 +806,7 @@
 				release_arcbuf(dev, lp->cur_tx);
 
 			lp->cur_tx = -1;
+			lp->timed_out = 0;
 			didsomething++;
 
 			/* send another packet if there is one */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)