diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2021-06-30 09:44:00 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2021-06-30 09:44:00 +0000 |
commit | 284c810b7b5b36b7f18c7096aec299acbe8d2308 (patch) | |
tree | c2fed278d545f8783006fe2d67ad17caecb34bce /sys/dev | |
parent | 6c9540208bad2f425b621c9896387f9649b11103 (diff) |
Make the iwm(4) mac context task send its command only if we are still in
RUN state when the task gets to run. Fixes fatal firmware errors where
mac context updates were erroneously sent in states other than RUN state.
Additionally, avoid scheduling a mac context task if a pending newstate
task is going to move us out of RUN state anyway.
Issue debugged by zxystd in OpenIntelWireless itlwm; patch by me.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_iwm.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index 026d797f5c9..f396e5d64a0 100644 --- a/sys/dev/pci/if_iwm.c +++ b/sys/dev/pci/if_iwm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwm.c,v 1.330 2021/06/30 09:42:22 stsp Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.331 2021/06/30 09:43:59 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh <info@genua.de> @@ -3223,7 +3223,8 @@ iwm_mac_ctxt_task(void *arg) struct iwm_node *in = (void *)ic->ic_bss; int err, s = splnet(); - if (sc->sc_flags & IWM_FLAG_SHUTDOWN) { + if ((sc->sc_flags & IWM_FLAG_SHUTDOWN) || + ic->ic_state != IEEE80211_S_RUN) { refcnt_rele_wake(&sc->task_refs); splx(s); return; @@ -3242,7 +3243,8 @@ iwm_updateprot(struct ieee80211com *ic) { struct iwm_softc *sc = ic->ic_softc; - if (ic->ic_state == IEEE80211_S_RUN) + if (ic->ic_state == IEEE80211_S_RUN && + !task_pending(&sc->newstate_task)) iwm_add_task(sc, systq, &sc->mac_ctxt_task); } @@ -3251,7 +3253,8 @@ iwm_updateslot(struct ieee80211com *ic) { struct iwm_softc *sc = ic->ic_softc; - if (ic->ic_state == IEEE80211_S_RUN) + if (ic->ic_state == IEEE80211_S_RUN && + !task_pending(&sc->newstate_task)) iwm_add_task(sc, systq, &sc->mac_ctxt_task); } @@ -3260,7 +3263,8 @@ iwm_updateedca(struct ieee80211com *ic) { struct iwm_softc *sc = ic->ic_softc; - if (ic->ic_state == IEEE80211_S_RUN) + if (ic->ic_state == IEEE80211_S_RUN && + !task_pending(&sc->newstate_task)) iwm_add_task(sc, systq, &sc->mac_ctxt_task); } |