]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: mt76: fix deadlock in remain-on-channel
authorChad Monroe <chad@monroe.io>
Mon, 8 Dec 2025 14:31:32 +0000 (14:31 +0000)
committerFelix Fietkau <nbd@nbd.name>
Mon, 23 Mar 2026 09:23:01 +0000 (09:23 +0000)
commit6939b97ddad3cf3dfbb3b5a0a12ef79cb886747e
tree862d72d581c9d78e7a2dbf4e2d20d988e4434712
parentd5059e52fd8bc624ec4255c9fa01a266513d126b
wifi: mt76: fix deadlock in remain-on-channel

mt76_remain_on_channel() and mt76_roc_complete() call mt76_set_channel()
while already holding dev->mutex. Since mt76_set_channel() also acquires
dev->mutex, this results in a deadlock.

Use __mt76_set_channel() instead of mt76_set_channel().
Add cancel_delayed_work_sync() for mac_work before acquiring the mutex
in mt76_remain_on_channel() to prevent a secondary deadlock with the
mac_work workqueue.

Fixes: a8f424c1287c ("wifi: mt76: add multi-radio remain_on_channel functions")
Signed-off-by: Chad Monroe <chad@monroe.io>
Link: https://patch.msgid.link/ace737e7b621af7c2adb33b0188011a5c1de2166.1765204256.git.chad@monroe.io
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/channel.c