From 3d47eba8d914bc45a00dd233ec43b51d32d6d8ec Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 19 Aug 2024 20:21:04 +0200 Subject: [PATCH] wifi: mt76: mt7915: hold dev->mt76.mutex while disabling tx worker Prevent racing against other functions disabling the same worker Signed-off-by: Felix Fietkau --- mt7915/mac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mt7915/mac.c b/mt7915/mac.c index dcec27be..fc03cb49 100644 --- a/mt7915/mac.c +++ b/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);