From 5ac02e22fb03a5c2ff1cadb1c69f64c8d468e189 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 13 Apr 2021 20:09:33 +0200 Subject: [PATCH] mt76: flush tx status queue on DMA reset After DMA reset, tx status information for queued frames will never arrive. Flush the queue to free skbs immediately instead of waiting for a timeout Signed-off-by: Felix Fietkau --- mt7603/mac.c | 2 ++ mt7615/pci_mac.c | 2 ++ mt76x02_mmio.c | 2 ++ mt7915/mac.c | 2 ++ mt7921/mac.c | 2 ++ 5 files changed, 10 insertions(+) diff --git a/mt7603/mac.c b/mt7603/mac.c index e3a9dd6f..fbceb07c 100644 --- a/mt7603/mac.c +++ b/mt7603/mac.c @@ -1445,6 +1445,8 @@ static void mt7603_mac_watchdog_reset(struct mt7603_dev *dev) mt76_queue_rx_reset(dev, i); } + mt76_tx_status_check(&dev->mt76, NULL, true); + mt7603_dma_sched_reset(dev); mt7603_mac_dma_start(dev); diff --git a/mt7615/pci_mac.c b/mt7615/pci_mac.c index 9ac4bdab..8cd79e84 100644 --- a/mt7615/pci_mac.c +++ b/mt7615/pci_mac.c @@ -201,6 +201,8 @@ void mt7615_dma_reset(struct mt7615_dev *dev) mt76_for_each_q_rx(&dev->mt76, i) mt76_queue_rx_reset(dev, i); + mt76_tx_status_check(&dev->mt76, NULL, true); + mt7615_dma_start(dev); } EXPORT_SYMBOL_GPL(mt7615_dma_reset); diff --git a/mt76x02_mmio.c b/mt76x02_mmio.c index 953cb100..d8631035 100644 --- a/mt76x02_mmio.c +++ b/mt76x02_mmio.c @@ -471,6 +471,8 @@ static void mt76x02_watchdog_reset(struct mt76x02_dev *dev) mt76_queue_rx_reset(dev, i); } + mt76_tx_status_check(&dev->mt76, NULL, true); + mt76x02_mac_start(dev); if (dev->ed_monitor) diff --git a/mt7915/mac.c b/mt7915/mac.c index 35ab4bf0..6a4b5750 100644 --- a/mt7915/mac.c +++ b/mt7915/mac.c @@ -1564,6 +1564,8 @@ mt7915_dma_reset(struct mt7915_dev *dev) mt76_for_each_q_rx(&dev->mt76, i) mt76_queue_rx_reset(dev, i); + mt76_tx_status_check(&dev->mt76, NULL, true); + /* re-init prefetch settings after reset */ mt7915_dma_prefetch(dev); diff --git a/mt7921/mac.c b/mt7921/mac.c index 4c810bef..1c3ea9cf 100644 --- a/mt7921/mac.c +++ b/mt7921/mac.c @@ -1254,6 +1254,8 @@ mt7921_dma_reset(struct mt7921_dev *dev) mt76_for_each_q_rx(&dev->mt76, i) mt76_queue_reset(dev, &dev->mt76.q_rx[i]); + mt76_tx_status_check(&dev->mt76, NULL, true); + /* configure perfetch settings */ mt7921_dma_prefetch(dev);