From f8b61c27d3139a02884ec7c20eeeccc797eeeb19 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 27 Feb 2016 18:25:24 +0100 Subject: [PATCH] dma: fix tx ring flush Signed-off-by: Felix Fietkau --- dma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dma.c b/dma.c index f0dd6024..dff9bd6a 100644 --- a/dma.c +++ b/dma.c @@ -152,11 +152,13 @@ mt76_dma_tx_cleanup(struct mt76_dev *dev, enum mt76_txq_id qid, bool flush) q->tail = (q->tail + 1) % q->ndesc; q->queued--; - if (q->tail == last) + if (!flush && q->tail == last) last = ioread32(&q->regs->dma_idx); } if (!flush) mt76_txq_schedule(dev, q); + else + iowrite32(q->tail, &q->regs->dma_idx); spin_unlock_bh(&q->lock); }