From: Valera Kozlov <valera.kozlov19@gmail.com>
To: Felix Fietkau <nbd@nbd.name>,
Lorenzo Bianconi <lorenzo@kernel.org>,
Ryder Lee <ryder.lee@mediatek.com>
Cc: Shayne Chen <shayne.chen@mediatek.com>,
Sean Wang <sean.wang@mediatek.com>,
linux-wireless@vger.kernel.org,
Valera Kozlov <valera.kozlov19@gmail.com>
Subject: [PATCH] wifi: mt76: mt7996: route disassoc frames to ALTXQ
Date: Mon, 24 Aug 2026 09:39:01 +0300 [thread overview]
Message-ID: <20260824063901.311-1-valera.kozlov19@gmail.com> (raw)
If AP sends deauth or disassoc to a peer station while the station is
in power-save mode, the frame may queue in the normal ACQ and lead to
PLE hang, since the station won't wake up to receive it.
Deauth frames are already routed to MT_TXQ_PSD / ALTX0. Extend the
same handling to disassoc frames, and additionally route any frame to
a station that hasn't completed authorization (tx_info without
MT_WCID_TX_INFO_SET) to ALTX0 in mt7996_mac_write_txwi(), clearing the
flag again on MT76_STA_EVENT_DISASSOC so it gets re-armed on the next
association.
MediaTek's vendor tree has an equivalent fix, though written against
a newer MLO-aware version of this code that doesn't apply directly to
this tree:
https://github.com/mediatek/mtk-openwrt-feeds/commit/ed6924828479aaeadbb7c402ec390df26dcbd8bc
Signed-off-by: Valera Kozlov <valera.kozlov19@gmail.com>
---
mt7996/mac.c | 2 +-
mt7996/main.c | 1 +
tx.c | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/mt7996/mac.c b/mt7996/mac.c
index 570f85d7..10d4264c 100644
--- a/mt7996/mac.c
+++ b/mt7996/mac.c
@@ -932,7 +932,7 @@ void mt7996_mac_write_txwi(struct mt7996_dev *dev, __le32 *txwi,
} else if (beacon) {
p_fmt = MT_TX_TYPE_FW;
q_idx = MT_LMAC_BCN0;
- } else if (qid >= MT_TXQ_PSD) {
+ } else if (qid >= MT_TXQ_PSD || (!(wcid->tx_info & MT_WCID_TX_INFO_SET))) {
p_fmt = MT_TX_TYPE_CT;
q_idx = MT_LMAC_ALTX0;
} else {
diff --git a/mt7996/main.c b/mt7996/main.c
index 1afb926c..8d45af3e 100644
--- a/mt7996/main.c
+++ b/mt7996/main.c
@@ -1414,6 +1414,7 @@ mt7996_mac_sta_event(struct mt7996_dev *dev, struct ieee80211_vif *vif,
goto unlock;
break;
case MT76_STA_EVENT_DISASSOC:
+ msta_link->wcid.tx_info &= ~MT_WCID_TX_INFO_SET;
for (i = 0; i < ARRAY_SIZE(msta_link->twt.flow); i++)
mt7996_mac_twt_teardown_flow(dev, link,
msta_link, i);
diff --git a/tx.c b/tx.c
index b863e449..6bcad275 100644
--- a/tx.c
+++ b/tx.c
@@ -689,6 +689,7 @@ mt76_txq_schedule_pending_wcid(struct mt76_phy *phy, struct mt76_wcid *wcid,
!ieee80211_is_data_present(hdr->frame_control) &&
(!ieee80211_is_bufferable_mmpdu(skb) ||
ieee80211_is_deauth(hdr->frame_control) ||
+ ieee80211_is_disassoc(hdr->frame_control) ||
head == &wcid->tx_offchannel))
qid = MT_TXQ_PSD;
--
2.53.0
reply other threads:[~2026-08-24 6:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260824063901.311-1-valera.kozlov19@gmail.com \
--to=valera.kozlov19@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
--cc=ryder.lee@mediatek.com \
--cc=sean.wang@mediatek.com \
--cc=shayne.chen@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox