mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: fix potential deadlock on cancelling workqueues
mutex->lock must not be held while cancelling workqueues, because it is held by the workqueue items themselves Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
+2
-2
@@ -91,6 +91,7 @@ static void mt76x0u_mac_stop(struct mt76x02_dev *dev)
|
||||
if (test_bit(MT76_REMOVED, &dev->mt76.state))
|
||||
return;
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
mt76_clear(dev, MT_BEACON_TIME_CFG, MT_BEACON_TIME_CFG_TIMER_EN |
|
||||
MT_BEACON_TIME_CFG_SYNC_MODE | MT_BEACON_TIME_CFG_TBTT_EN |
|
||||
MT_BEACON_TIME_CFG_BEACON_TX);
|
||||
@@ -102,6 +103,7 @@ static void mt76x0u_mac_stop(struct mt76x02_dev *dev)
|
||||
|
||||
if (!mt76_poll(dev, MT_USB_DMA_CFG, MT_USB_DMA_CFG_RX_BUSY, 0, 1000))
|
||||
dev_warn(dev->mt76.dev, "RX DMA did not stop\n");
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
}
|
||||
|
||||
static int mt76x0u_start(struct ieee80211_hw *hw)
|
||||
@@ -131,9 +133,7 @@ static void mt76x0u_stop(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct mt76x02_dev *dev = hw->priv;
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
mt76x0u_mac_stop(dev);
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
}
|
||||
|
||||
static const struct ieee80211_ops mt76x0u_ops = {
|
||||
|
||||
Reference in New Issue
Block a user