wifi: mt76: mt7915: fix error recovery with WED enabled
authorFelix Fietkau <nbd@nbd.name>
Thu, 18 Jan 2024 14:51:53 +0000 (15:51 +0100)
committerFelix Fietkau <nbd@nbd.name>
Thu, 22 Feb 2024 08:55:16 +0000 (09:55 +0100)
Do not clear the interrupt mask register on MT7915, since that prevents
MCU_CMD interrupts from being reported, thus causing timeouts during the
reset sequence. Defer stopping WED until tx/rx processing activity has
stopped.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7915/mac.c

index b01edbed969cacc3edb344437c13773b078e36f0..e45361111f9bf3d5fb36dfec172fbb2802765ec1 100644 (file)
@@ -1520,12 +1520,6 @@ void mt7915_mac_reset_work(struct work_struct *work)
        if (!(READ_ONCE(dev->recovery.state) & MT_MCU_CMD_STOP_DMA))
                return;
 
-       if (mtk_wed_device_active(&dev->mt76.mmio.wed)) {
-               mtk_wed_device_stop(&dev->mt76.mmio.wed);
-               if (!is_mt798x(&dev->mt76))
-                       mt76_wr(dev, MT_INT_WED_MASK_CSR, 0);
-       }
-
        ieee80211_stop_queues(mt76_hw(dev));
        if (ext_phy)
                ieee80211_stop_queues(ext_phy->hw);
@@ -1545,6 +1539,9 @@ void mt7915_mac_reset_work(struct work_struct *work)
 
        mutex_lock(&dev->mt76.mutex);
 
+       if (mtk_wed_device_active(&dev->mt76.mmio.wed))
+               mtk_wed_device_stop(&dev->mt76.mmio.wed);
+
        mt76_wr(dev, MT_MCU_INT_EVENT, MT_MCU_INT_EVENT_DMA_STOPPED);
 
        if (mt7915_wait_reset_state(dev, MT_MCU_CMD_RESET_DONE)) {