diff options
author | Felix Fietkau <nbd@nbd.name> | 2020-11-21 18:23:35 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2020-12-04 14:31:16 +0100 |
commit | 9716ef046b46a6426b2a11301ea5232fc8cdce63 (patch) | |
tree | bf3ebcb4e5375b34f064a5856af46ffedf37d28d /drivers/net/wireless/mediatek/mt76/dma.c | |
parent | mt76: mt7915: stop queues when running out of tx tokens (diff) | |
download | linux-9716ef046b46a6426b2a11301ea5232fc8cdce63.tar.xz linux-9716ef046b46a6426b2a11301ea5232fc8cdce63.zip |
mt76: attempt to free up more room when filling the tx queue
Run dma cleanup immediately if the queue is almost full, instead of waiting
for the tx interrupt
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.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c index 6255f4f0a455..73eeb00d5aa6 100644 --- a/drivers/net/wireless/mediatek/mt76/dma.c +++ b/drivers/net/wireless/mediatek/mt76/dma.c @@ -88,6 +88,7 @@ mt76_dma_alloc_queue(struct mt76_dev *dev, struct mt76_queue *q, int i; spin_lock_init(&q->lock); + spin_lock_init(&q->cleanup_lock); q->regs = dev->mmio.regs + ring_base + idx * MT_RING_SIZE; q->ndesc = n_desc; @@ -225,6 +226,7 @@ mt76_dma_tx_cleanup(struct mt76_dev *dev, struct mt76_queue *q, bool flush) if (!q) return; + spin_lock_bh(&q->cleanup_lock); if (flush) last = -1; else @@ -243,6 +245,7 @@ mt76_dma_tx_cleanup(struct mt76_dev *dev, struct mt76_queue *q, bool flush) last = readl(&q->regs->dma_idx); } + spin_unlock_bh(&q->cleanup_lock); if (flush) { spin_lock_bh(&q->lock); |