iwm: Drain callouts after stopping the device during detach.
Otherwise there is a window where they may be rescheduled. This typically manifested as a page fault shortly after unloading if_iwm.ko. Close the race by draining callouts after calling iwm_stop_device(), which is also what Dragonfly does. Change whitespace to reduce gratuitous diffs with Dragonfly. Reported and tested by: seanc MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
2302351791
commit
dda0c86204
@ -6330,12 +6330,9 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211)
|
||||
if (!sc->sc_attached)
|
||||
return 0;
|
||||
sc->sc_attached = 0;
|
||||
|
||||
if (do_net80211)
|
||||
if (do_net80211) {
|
||||
ieee80211_draintask(&sc->sc_ic, &sc->sc_es_task);
|
||||
|
||||
callout_drain(&sc->sc_led_blink_to);
|
||||
callout_drain(&sc->sc_watchdog_to);
|
||||
}
|
||||
iwm_stop_device(sc);
|
||||
if (do_net80211) {
|
||||
IWM_LOCK(sc);
|
||||
@ -6343,6 +6340,8 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211)
|
||||
IWM_UNLOCK(sc);
|
||||
ieee80211_ifdetach(&sc->sc_ic);
|
||||
}
|
||||
callout_drain(&sc->sc_led_blink_to);
|
||||
callout_drain(&sc->sc_watchdog_to);
|
||||
|
||||
iwm_phy_db_free(sc->sc_phy_db);
|
||||
sc->sc_phy_db = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user