Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Feb 2003 21:21:55 -0800
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        kuku@www.kukulies.org, freebsd-current@FreeBSD.ORG
Subject:   [patch] wi: device timeout [was: Re: wi0: tx failed, retry limit exceeded]
Message-ID:  <20030228052155.GB1062@athlon.pn.xcllnt.net>
In-Reply-To: <20030227.215348.84365408.imp@bsdimp.com>
References:  <200302261011.h1QABjmT000629@www.kukulies.org> <20030227.215348.84365408.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--PEIAKu/WMn1b1Hv9
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Feb 27, 2003 at 09:53:48PM -0700, M. Warner Losh wrote:
> : 
> : Now I'm getting kernel messages
> : 
> : wi0: tx failed, retry limit exceeded.
> 
> These are bogus and can be ignored.  The old driver didn't report
> them.
> 
> However, there are, ah, other issues with the latest wi driver. :-(

The attached patch fixes the device timeout problem. I don't claim
it is correct, but may serve as the basis for experimentation (is
it the limit of 10 iterations, is it the fiddling with status bits
or something else).

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net

--PEIAKu/WMn1b1Hv9
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="wi.diff"

Index: if_wi.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/wi/if_wi.c,v
retrieving revision 1.130
diff -u -r1.130 if_wi.c
--- if_wi.c	26 Feb 2003 17:18:35 -0000	1.130
+++ if_wi.c	28 Feb 2003 04:46:46 -0000
@@ -555,10 +555,9 @@
 void
 wi_intr(void *arg)
 {
-	int i;
 	struct wi_softc *sc = arg;
 	struct ifnet *ifp = &sc->sc_ic.ic_if;
-	u_int16_t status, raw_status, last_status;
+	u_int16_t status;
 	WI_LOCK_DECL();
 
 	WI_LOCK(sc);
@@ -570,21 +569,10 @@
 		return;
 	}
 
-	/* maximum 10 loops per interrupt */
-	last_status = 0;
-	for (i = 0; i < 10; i++) {
-		/*
-		 * Only believe a status bit when we enter wi_intr, or when
-		 * the bit was "off" the last time through the loop. This is
-		 * my strategy to avoid racing the hardware/firmware if I
-		 * can re-read the event status register more quickly than
-		 * it is updated.
-		 */
-		raw_status = CSR_READ_2(sc, WI_EVENT_STAT);
-		status = raw_status & ~last_status;
+	do {
+		status = CSR_READ_2(sc, WI_EVENT_STAT);
 		if ((status & WI_INTRS) == 0)
 			break;
-		last_status = raw_status;
 
 		if (status & WI_EV_RX)
 			wi_rx_intr(sc);
@@ -602,7 +590,7 @@
 		    (sc->sc_flags & WI_FLAGS_OUTRANGE) == 0 &&
 		    _IF_QLEN(&ifp->if_snd) != 0)
 			wi_start(ifp);
-	}
+	} while (1);
 
 	WI_UNLOCK(sc);
 

--PEIAKu/WMn1b1Hv9--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030228052155.GB1062>