summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYan-Hsuan Chuang <yhchuang@realtek.com>2019-09-16 09:03:35 +0200
committerKalle Valo <kvalo@codeaurora.org>2019-09-21 07:47:27 +0200
commit0e41edcdfe86435fef709b7de8397e8a5a0e1b2f (patch)
treee60a40d2cbeda44be329936a42bb59626a9d43cf
parentrtw88: pci: extract skbs free routine for trx rings (diff)
downloadlinux-0e41edcdfe86435fef709b7de8397e8a5a0e1b2f.tar.xz
linux-0e41edcdfe86435fef709b7de8397e8a5a0e1b2f.zip
rtw88: pci: release tx skbs DMAed when stop
Interrupt is disabled to stop PCI, which means the skbs queued for each TX ring will not be released via DMA interrupt. To avoid those skbs remained being left in the skb queue until PCI has been removed, driver needs to release skbs by itself. Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Reviewed-by: Brian Norris <briannorris@chromium.org> Tested-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r--drivers/net/wireless/realtek/rtw88/pci.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c
index bc3a36402e56..d90928be663b 100644
--- a/drivers/net/wireless/realtek/rtw88/pci.c
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
@@ -500,6 +500,17 @@ static void rtw_pci_dma_reset(struct rtw_dev *rtwdev, struct rtw_pci *rtwpci)
rtwpci->rx_tag = 0;
}
+static void rtw_pci_dma_release(struct rtw_dev *rtwdev, struct rtw_pci *rtwpci)
+{
+ struct rtw_pci_tx_ring *tx_ring;
+ u8 queue;
+
+ for (queue = 0; queue < RTK_MAX_TX_QUEUE_NUM; queue++) {
+ tx_ring = &rtwpci->tx_rings[queue];
+ rtw_pci_free_tx_ring_skbs(rtwdev, tx_ring);
+ }
+}
+
static int rtw_pci_start(struct rtw_dev *rtwdev)
{
struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv;
@@ -521,6 +532,7 @@ static void rtw_pci_stop(struct rtw_dev *rtwdev)
spin_lock_irqsave(&rtwpci->irq_lock, flags);
rtw_pci_disable_interrupt(rtwdev, rtwpci);
+ rtw_pci_dma_release(rtwdev, rtwpci);
spin_unlock_irqrestore(&rtwpci->irq_lock, flags);
}