]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: mt76: avoid to set ACK for MCU command if wait_resp is not set
authorStanleyYP Wang <StanleyYP.Wang@mediatek.com>
Tue, 3 Feb 2026 15:55:31 +0000 (23:55 +0800)
committerFelix Fietkau <nbd@nbd.name>
Tue, 24 Mar 2026 15:49:30 +0000 (15:49 +0000)
commit169c83d3df95b57e787174454332e01eb1b823ed
treeb09ead46dc0fc6e13197b007258cdbb149d36496
parentefbd5bf395f4e6b45a87f3835d4c2e28170c77c5
wifi: mt76: avoid to set ACK for MCU command if wait_resp is not set

When wait_resp is not set but the ACK option is enabled in the MCU TXD,
the ACK event is enqueued to the MCU event queue without being dequeued
by the original MCU command request.

Any orphaned ACK events will only be removed from the queue when another
MCU command requests a response. Due to sequence index mismatches, these
events are discarded one by one until a matching sequence index is found.

However, if several MCU commands that do not require a response continue
to fill up the event queue, there is a risk that when an MCU command with
wait_resp enabled is issued, it may dequeue the wrong event skb,
especially if the queue contains events with all possible sequence
indices.

Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20260203155532.1098290-3-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mcu.c
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c