summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/dma.c
diff options
context:
space:
mode:
authorSean Wang <sean.wang@mediatek.com>2023-09-27 00:20:25 +0200
committerFelix Fietkau <nbd@nbd.name>2023-09-30 20:17:18 +0200
commitef444ad00474bc5ebbcd4f6a2ea87f6fbe7977ce (patch)
tree06c5fa12b836135bc27038be6efaedf69412e778 /drivers/net/wireless/mediatek/mt76/dma.c
parentwifi: mt76: mt7996: remove periodic MPDU TXS request (diff)
downloadlinux-ef444ad00474bc5ebbcd4f6a2ea87f6fbe7977ce.tar.xz
linux-ef444ad00474bc5ebbcd4f6a2ea87f6fbe7977ce.zip
wifi: mt76: reduce spin_lock_bh held up in mt76_dma_rx_cleanup
mt76_dma_rx_cleanup would be frequenetly called up to reset the dma rings to be freshed as new ones when switching back from the deep sleep mode to the active mode on mt7921 and mt7922. Shrink the scope of spin_lock_bh in mt76_dma_rx_cleanup being held up to allow the kernel scheduler to be able to switch other tasks in time by reducing the latency. Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/dma.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/dma.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c
index 643e18ebb5ee..5f31d4d6a640 100644
--- a/drivers/net/wireless/mediatek/mt76/dma.c
+++ b/drivers/net/wireless/mediatek/mt76/dma.c
@@ -739,16 +739,18 @@ mt76_dma_rx_cleanup(struct mt76_dev *dev, struct mt76_queue *q)
if (!q->ndesc)
return;
- spin_lock_bh(&q->lock);
-
do {
+ spin_lock_bh(&q->lock);
buf = mt76_dma_dequeue(dev, q, true, NULL, NULL, &more, NULL);
+ spin_unlock_bh(&q->lock);
+
if (!buf)
break;
mt76_put_page_pool_buf(buf, false);
} while (1);
+ spin_lock_bh(&q->lock);
if (q->rx_head) {
dev_kfree_skb(q->rx_head);
q->rx_head = NULL;