Commit c677dda1 authored by Felix Fietkau's avatar Felix Fietkau

wifi: mt76: mt7603: improve watchdog reset reliablity

Only trigger PSE reset if PSE was stuck, otherwise it can cause DMA issues.
Trigger the PSE reset while DMA is fully stopped in order to improve
reliabilty.

Fixes: c8846e10 ("mt76: add driver for MT7603E and MT7628/7688")
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent baa19b2e
...@@ -1441,15 +1441,6 @@ static void mt7603_mac_watchdog_reset(struct mt7603_dev *dev) ...@@ -1441,15 +1441,6 @@ static void mt7603_mac_watchdog_reset(struct mt7603_dev *dev)
mt7603_beacon_set_timer(dev, -1, 0); mt7603_beacon_set_timer(dev, -1, 0);
if (dev->reset_cause[RESET_CAUSE_RESET_FAILED] ||
dev->cur_reset_cause == RESET_CAUSE_RX_PSE_BUSY ||
dev->cur_reset_cause == RESET_CAUSE_BEACON_STUCK ||
dev->cur_reset_cause == RESET_CAUSE_TX_HANG)
mt7603_pse_reset(dev);
if (dev->reset_cause[RESET_CAUSE_RESET_FAILED])
goto skip_dma_reset;
mt7603_mac_stop(dev); mt7603_mac_stop(dev);
mt76_clear(dev, MT_WPDMA_GLO_CFG, mt76_clear(dev, MT_WPDMA_GLO_CFG,
...@@ -1459,28 +1450,32 @@ static void mt7603_mac_watchdog_reset(struct mt7603_dev *dev) ...@@ -1459,28 +1450,32 @@ static void mt7603_mac_watchdog_reset(struct mt7603_dev *dev)
mt7603_irq_disable(dev, mask); mt7603_irq_disable(dev, mask);
mt76_set(dev, MT_WPDMA_GLO_CFG, MT_WPDMA_GLO_CFG_FORCE_TX_EOF);
mt7603_pse_client_reset(dev); mt7603_pse_client_reset(dev);
mt76_queue_tx_cleanup(dev, dev->mt76.q_mcu[MT_MCUQ_WM], true); mt76_queue_tx_cleanup(dev, dev->mt76.q_mcu[MT_MCUQ_WM], true);
for (i = 0; i < __MT_TXQ_MAX; i++) for (i = 0; i < __MT_TXQ_MAX; i++)
mt76_queue_tx_cleanup(dev, dev->mphy.q_tx[i], true); mt76_queue_tx_cleanup(dev, dev->mphy.q_tx[i], true);
mt7603_dma_sched_reset(dev);
mt76_tx_status_check(&dev->mt76, true);
mt76_for_each_q_rx(&dev->mt76, i) { mt76_for_each_q_rx(&dev->mt76, i) {
mt76_queue_rx_reset(dev, i); mt76_queue_rx_reset(dev, i);
} }
mt76_tx_status_check(&dev->mt76, true); if (dev->reset_cause[RESET_CAUSE_RESET_FAILED] ||
dev->cur_reset_cause == RESET_CAUSE_RX_PSE_BUSY)
mt7603_dma_sched_reset(dev); mt7603_pse_reset(dev);
if (!dev->reset_cause[RESET_CAUSE_RESET_FAILED]) {
mt7603_mac_dma_start(dev); mt7603_mac_dma_start(dev);
mt7603_irq_enable(dev, mask); mt7603_irq_enable(dev, mask);
skip_dma_reset:
clear_bit(MT76_RESET, &dev->mphy.state); clear_bit(MT76_RESET, &dev->mphy.state);
}
mutex_unlock(&dev->mt76.mutex); mutex_unlock(&dev->mt76.mutex);
mt76_worker_enable(&dev->mt76.tx_worker); mt76_worker_enable(&dev->mt76.tx_worker);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment