Skip to content

Commit 70656b4

Browse files
LorenzoBianconigregkh
authored andcommitted
wifi: mt76: Move mt76_abort_scan out of mt76_reset_device()
[ Upstream commit 6aaaaea ] Move mt76_abort_scan routine out of mt76_reset_device() in order to avoid a possible deadlock since mt76_reset_device routine is running with mt76 mutex help and mt76_abort_scan_complete() can grab mt76 mutex in some cases. Fixes: b36d556 ("wifi: mt76: abort scan/roc on hw restart") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Tested-by: Ben Greear <greearb@candelatech.com> Link: https://patch.msgid.link/20251114-mt76-fix-missing-mtx-v1-3-259ebf11f654@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 46f0648 commit 70656b4

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

drivers/net/wireless/mediatek/mt76/mac80211.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,8 +847,6 @@ void mt76_reset_device(struct mt76_dev *dev)
847847
}
848848
rcu_read_unlock();
849849

850-
mt76_abort_scan(dev);
851-
852850
INIT_LIST_HEAD(&dev->wcid_list);
853851
INIT_LIST_HEAD(&dev->sta_poll_list);
854852
dev->vif_mask = 0;

drivers/net/wireless/mediatek/mt76/mt7915/mac.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,6 +1451,8 @@ mt7915_mac_full_reset(struct mt7915_dev *dev)
14511451
if (ext_phy)
14521452
cancel_delayed_work_sync(&ext_phy->mac_work);
14531453

1454+
mt76_abort_scan(&dev->mt76);
1455+
14541456
mutex_lock(&dev->mt76.mutex);
14551457
for (i = 0; i < 10; i++) {
14561458
if (!mt7915_mac_restart(dev))

drivers/net/wireless/mediatek/mt76/mt7996/mac.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2424,6 +2424,8 @@ mt7996_mac_full_reset(struct mt7996_dev *dev)
24242424
mt7996_for_each_phy(dev, phy)
24252425
cancel_delayed_work_sync(&phy->mt76->mac_work);
24262426

2427+
mt76_abort_scan(&dev->mt76);
2428+
24272429
mutex_lock(&dev->mt76.mutex);
24282430
for (i = 0; i < 10; i++) {
24292431
if (!mt7996_mac_restart(dev))

0 commit comments

Comments
 (0)