]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: mt76: mt7921: refactor regd update to fix recursive mutex deadlock
authorCharlie-cy Wu <charlie-cy.wu@mediatek.corp-partner.google.com>
Mon, 29 Jun 2026 08:35:43 +0000 (16:35 +0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 16 Aug 2026 18:07:18 +0000 (11:07 -0700)
commitd6e7d57ed967def9c964a58328ffba409f7efb64
tree045c036568c4947493f72a01e8ee40e36eb5a5ef
parentd5b95e612cde33f9def1a7a6c3242d03d3bbde3a
wifi: mt76: mt7921: refactor regd update to fix recursive mutex deadlock

Split mt7921_mcu_regd_update() into two functions to prevent recursive
mutex acquisition. Introduce __mt7921_mcu_regd_update() as the internal
implementation that assumes the mutex is already held by the caller,
while mt7921_mcu_regd_update() remains as the external interface that
handles mutex acquisition and release.

This fixes a deadlock issue when mt7921_regd_set_6ghz_power_type() is
called with the device mutex already held. Without this change, calling
mt7921_mcu_regd_update() would attempt to acquire the same mutex again,
causing a recursive lock deadlock.

The __mt7921_mcu_regd_update() function can be safely called when the
caller has already acquired the device mutex, avoiding the deadlock
while maintaining proper synchronization for regulatory domain updates.

Fixes: dc2608cf5224 ("wifi: mt76: mt7921: refactor regulatory notifier flow")
Signed-off-by: Charlie-cy Wu <Charlie-cy.Wu@mediatek.com>
Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Tested-by: Devin Wittmayer <lucid_duck@justthetip.ca>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/net/wireless/mediatek/mt76/mt7921/main.c
drivers/net/wireless/mediatek/mt76/mt7921/regd.c
drivers/net/wireless/mediatek/mt76/mt7921/regd.h