On Sun, May 09, 2021 at 02:24:08PM +0200, Matthias Schmidt wrote: > I had the Laptop running over the weekend and generated a lot of network > traffic. As you can see from the logs below, the error occurred again, > however, in a much lower frequency. Also the device recovered itself so > it was hardly noticeable. > > Let me know if there is more to test...
Please enable 'ifconfig iwm0 debug' permanently for a while, like this: echo debug >> /etc/hostname.iwm0 Then we can see what the driver was trying to do when a firmware error occurs. I suspect background scans might be related since this is the only case where the driver would try to add the firmware station while it is in RUN state. The additional debug output should tell us whether this is indeed the case. The patch below fixes some obvious bugs which are probably related. There is more to do here (e.g. we don't reset in->tid_disable_ampdu properly on errors) but let's get these minimal fixes checked first. Can you please run with this and let me know if it changes anything? diff 1bb5471fbe28d6451a6d0fcf81c4d3674641dea1 09f7572eaa7ad00f2a7fa7b0800fd0b0fea35c31 blob - f3380617f2f5a80854e72b5a44cceff28d42aafc blob + 1a2589a9a592728af44ab57e7cab9b0d8a71cea3 --- sys/dev/pci/if_iwm.c +++ sys/dev/pci/if_iwm.c @@ -3314,7 +3314,7 @@ iwm_sta_tx_agg(struct iwm_softc *sc, struct ieee80211_ in->tid_disable_ampdu &= ~(1 << tid); in->tfd_queue_msk |= htole32(1 << qid); } else { - in->tid_disable_ampdu |= ~(1 << tid); + in->tid_disable_ampdu |= (1 << tid); /* Queue remains enabled in the TFD queue mask. */ err = iwm_flush_sta(sc, in); if (err) @@ -8079,6 +8079,7 @@ iwm_deauth(struct iwm_softc *sc) sc->sc_rx_ba_sessions = 0; sc->ba_rx.start_tidmask = 0; sc->ba_rx.stop_tidmask = 0; + sc->tx_ba_queue_mask = 0; sc->ba_tx.start_tidmask = 0; sc->ba_tx.stop_tidmask = 0; } @@ -8155,6 +8156,7 @@ iwm_disassoc(struct iwm_softc *sc) sc->sc_rx_ba_sessions = 0; sc->ba_rx.start_tidmask = 0; sc->ba_rx.stop_tidmask = 0; + sc->tx_ba_queue_mask = 0; sc->ba_tx.start_tidmask = 0; sc->ba_tx.stop_tidmask = 0; }