From c1bc888fc6d803d7dc2e5209a0a511de117e217a Mon Sep 17 00:00:00 2001 From: stsp Date: Fri, 24 Sep 2021 19:02:16 +0000 Subject: [PATCH] Reset the Tx timer when iwm(4) firmware sends a BA notification. This prevents a bogus "device timeout" if firmware sends a IWM_BA_NOTIF instead of IWM_TX_CMD in order to let us know that a frame has been sent on a Tx aggregation queue. Such behaviour was observed on iwx(4), and there is reason to believe that iwm(4) might also be affected by this issue. Tested by Jean-Michel Bessot on 7265 via bugs@ where this change seems to prevent random device timeouts. Tested by myself on 8265 with no apparent behaviour change seen. --- sys/dev/pci/if_iwm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index 58d7c6dcc1f..cb75fbf0f19 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.367 2021/09/08 13:06:23 stsp Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.368 2021/09/24 19:02:16 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh @@ -5720,6 +5720,8 @@ iwm_rx_compressed_ba(struct iwm_softc *sc, struct iwm_rx_packet *pkt, if (qid != IWM_FIRST_AGG_TX_QUEUE + ban->tid) return; + sc->sc_tx_timer = 0; + ba = &ni->ni_tx_ba[ban->tid]; if (ba->ba_state != IEEE80211_BA_AGREED) return; -- 2.20.1