summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2014-08-03 03:51:33 +0000
committeradrian <adrian@FreeBSD.org>2014-08-03 03:51:33 +0000
commitffb6d5c3967d1342fa5e2d6f51c8ea8aff1419e2 (patch)
treece018ca6220bddca705f0dc51f5b0a5182f8c6c0
parent17b754a0261fb1acd7f0974416bde5667c726f31 (diff)
downloadFreeBSD-src-ffb6d5c3967d1342fa5e2d6f51c8ea8aff1419e2.zip
FreeBSD-src-ffb6d5c3967d1342fa5e2d6f51c8ea8aff1419e2.tar.gz
Do the iwn(4) panic reinitialisation under IWN_LOCK().
I've checked each of the functions being called and there's either a _locked version or it's supposed to be called with IWN_LOCK() held.
-rw-r--r--sys/dev/iwn/if_iwn.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c
index c45d231..1b4c96a 100644
--- a/sys/dev/iwn/if_iwn.c
+++ b/sys/dev/iwn/if_iwn.c
@@ -8465,9 +8465,10 @@ iwn_panicked(void *arg0, int pending)
device_printf(sc->sc_dev, "%s: controller panicked, iv_state = %d; "
"resetting...\n", __func__, vap->iv_state);
- iwn_stop(sc);
- iwn_init(sc);
- iwn_start(sc->sc_ifp);
+ IWN_LOCK(sc);
+
+ iwn_stop_locked(sc);
+ iwn_init_locked(sc);
if (vap->iv_state >= IEEE80211_S_AUTH &&
(error = iwn_auth(sc, vap)) != 0) {
device_printf(sc->sc_dev,
@@ -8478,6 +8479,11 @@ iwn_panicked(void *arg0, int pending)
device_printf(sc->sc_dev,
"%s: could not move to run state\n", __func__);
}
+
+ /* Only run start once the NIC is in a useful state, like associated */
+ iwn_start_locked(sc->sc_ifp);
+
+ IWN_UNLOCK(sc);
}
static void
OpenPOWER on IntegriCloud