diff options
author | Felix Fietkau <nbd@nbd.name> | 2024-08-27 11:30:04 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2024-09-06 14:23:07 +0200 |
commit | 8f7152f10cb434f954aeff85ca1be9cd4d01912b (patch) | |
tree | e29a072478c3a6668b35874cfaa30409a1ba5cbb | |
parent | f2cc859149240d910fdc6405717673e0b84bfda8 (diff) |
wifi: mt76: mt7915: hold dev->mt76.mutex while disabling tx worker
Prevent racing against other functions disabling the same worker
Link: https://patch.msgid.link/20240827093011.18621-17-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c index dcec27be5a40..fc03cb499e71 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c @@ -1538,12 +1538,14 @@ void mt7915_mac_reset_work(struct work_struct *work) set_bit(MT76_RESET, &phy2->mt76->state); cancel_delayed_work_sync(&phy2->mt76->mac_work); } + + mutex_lock(&dev->mt76.mutex); + mt76_worker_disable(&dev->mt76.tx_worker); mt76_for_each_q_rx(&dev->mt76, i) napi_disable(&dev->mt76.napi[i]); napi_disable(&dev->mt76.tx_napi); - mutex_lock(&dev->mt76.mutex); if (mtk_wed_device_active(&dev->mt76.mmio.wed)) mtk_wed_device_stop(&dev->mt76.mmio.wed); |