Fix a race condition in owi. If you eject a card, then the wi_inquire

timeout would continue to happen: boom!  Fix this[*] by timing out earlier.

[*] almost fixes the race on unload: wi_inquire could be running when
untimeout is called, and there's no way to know when it has actually
returned.  This race is very rare and hard to lose.

Submitted by: scottl
This commit is contained in:
Warner Losh 2003-10-14 05:25:31 +00:00
parent 4d721ca3ae
commit 11a3320287

View File

@ -1901,6 +1901,8 @@ owi_stop(sc)
WI_LOCK(sc, s);
untimeout(wi_inquire, sc, sc->wi_stat_ch);
if (sc->wi_gone) {
WI_UNLOCK(sc, s);
return;
@ -1918,8 +1920,6 @@ owi_stop(sc)
wi_cmd(sc, WI_CMD_DISABLE|sc->wi_portnum, 0, 0, 0);
}
untimeout(wi_inquire, sc, sc->wi_stat_ch);
ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE);
WI_UNLOCK(sc, s);