mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76x02: clear running flag when resetting state on restart
Use it to avoid unsafe calls to mt76_wake_tx_queue Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
+5
-4
@@ -423,6 +423,8 @@ static void mt76x02_reset_state(struct mt76x02_dev *dev)
|
||||
{
|
||||
int i;
|
||||
|
||||
clear_bit(MT76_STATE_RUNNING, &dev->mt76.state);
|
||||
|
||||
rcu_read_lock();
|
||||
|
||||
ieee80211_iter_keys_rcu(dev->mt76.hw, NULL, mt76x02_key_sync, NULL);
|
||||
@@ -527,13 +529,12 @@ static void mt76x02_watchdog_reset(struct mt76x02_dev *dev)
|
||||
napi_schedule(&dev->mt76.napi[i]);
|
||||
}
|
||||
|
||||
ieee80211_wake_queues(dev->mt76.hw);
|
||||
|
||||
mt76_txq_schedule_all(&dev->mt76);
|
||||
|
||||
if (restart) {
|
||||
mt76x02_mcu_function_select(dev, Q_SELECT, 1);
|
||||
ieee80211_restart_hw(dev->mt76.hw);
|
||||
} else {
|
||||
ieee80211_wake_queues(dev->mt76.hw);
|
||||
mt76_txq_schedule_all(&dev->mt76);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -580,6 +580,9 @@ void mt76_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
|
||||
struct mt76_txq *mtxq = (struct mt76_txq *) txq->drv_priv;
|
||||
struct mt76_queue *hwq = mtxq->hwq;
|
||||
|
||||
if (!test_bit(MT76_STATE_RUNNING, &dev->state))
|
||||
return;
|
||||
|
||||
spin_lock_bh(&hwq->lock);
|
||||
if (list_empty(&mtxq->list))
|
||||
list_add_tail(&mtxq->list, &hwq->swq);
|
||||
|
||||
Reference in New Issue
Block a user