wifi: mt76: mt7603: avoid deadlock on failed channel config
Subsystems (2)
PATCH 1/1 wifi: mt76: mt7603: avoid deadlock on failed channel config
The synchronous call to mt7603_mac_work locks the global mt76 device mutex. This can create a deadlock situation, as the lock was already taken in mt76_set_channel.
Instead schedule the next mac_work iteration to happen immediately in case a reset is necessary and perform the reset asynchronously.
Signed-off-by David Bauer <[email protected]>
--- drivers/net/wireless/mediatek/mt76/mt7603/main.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7603/main.c +2 -6
@@ -172,9 +172,6 @@ int mt7603_set_channel(struct mt76_phy *mphy)mt7603_mac_set_timing (dev);mt7603_mac_start (dev); -ieee80211_queue_delayed_work (mt76_hw (dev), &dev->mphy.mac_work, -msecs_to_jiffies (MT7603_WATCHDOG_TIME )); -/* reset channel stats */ mt76_clear (dev,MT_MIB_CTL ,MT_MIB_CTL_READ_CLR_DIS ); mt76_set(dev, MT_MIB_CTL,
@@ -191,9 +188,8 @@ int mt7603_set_channel(struct mt76_phy *mphy)mt7603_beacon_set_timer (dev,-1 , dev->mt76.beacon_int);tasklet_enable (&dev->mt76.pre_tbtt_tasklet); - -if (failed) -mt7603_mac_work (&dev->mphy.mac_work.work); +ieee80211_queue_delayed_work (mt76_hw (dev), &dev->mphy.mac_work, + failed ?0 :msecs_to_jiffies (MT7603_WATCHDOG_TIME ));return ret; }
Signature · 1 line
2.53.0