Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/dev/pcmcia Apply patch (requested by martin):



details:   https://anonhg.NetBSD.org/src/rev/207a00c03a10
branches:  netbsd-1-5
changeset: 492820:207a00c03a10
user:      he <he%NetBSD.org@localhost>
date:      Sat Feb 23 16:52:22 2002 +0000

description:
Apply patch (requested by martin):
  Protect calls to wi_cmd() by proper spl* pairs, to avoid periodic
  busy loops.  Fixes PR#14559.
Diff is actually revision 1.40 of sys/dev/ic/wi.c (not on branch)

diffstat:

 sys/dev/pcmcia/if_wi.c |  16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diffs (52 lines):

diff -r c3bd07d377b1 -r 207a00c03a10 sys/dev/pcmcia/if_wi.c
--- a/sys/dev/pcmcia/if_wi.c    Sat Feb 23 16:41:28 2002 +0000
+++ b/sys/dev/pcmcia/if_wi.c    Sat Feb 23 16:52:22 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wi.c,v 1.21.2.9 2001/05/26 16:10:03 he Exp $        */
+/*     $NetBSD: if_wi.c,v 1.21.2.10 2002/02/23 16:52:22 he Exp $       */
 
 /*
  * Copyright (c) 1997, 1998, 1999
@@ -599,6 +599,7 @@
 {
        struct wi_softc         *sc;
        struct ifnet            *ifp;
+       int                     s;
 
        sc = xsc;
        ifp = &sc->sc_ethercom.ec_if;
@@ -606,14 +607,20 @@
        if ((sc->sc_dev.dv_flags & DVF_ACTIVE) == 0)
                return;
 
+       s = splnet();
+
        callout_reset(&sc->wi_inquire_ch, hz * 60, wi_inquire, sc);
 
        /* Don't do this while we're transmitting */
-       if (ifp->if_flags & IFF_OACTIVE)
+       if (ifp->if_flags & IFF_OACTIVE) {
+               splx(s);
                return;
+       }
 
        wi_cmd(sc, WI_CMD_INQUIRE, WI_INFO_COUNTERS);
 
+       splx(s);
+
        return;
 }
 
@@ -754,8 +761,11 @@
                }
        }
 
-       if (i == WI_TIMEOUT)
+       if (i == WI_TIMEOUT) {
+               printf("%s: wi_cmd timed out, cmd=0x%x\n",
+                       sc->sc_dev.dv_xname, cmd);
                return(ETIMEDOUT);
+       }
 
        return(0);
 }



Home | Main Index | Thread Index | Old Index