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          [EMAIL PROTECTED]
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);
 

Reply via email to