dma: fix tx ring flush

Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2016-02-27 18:30:58 +01:00
parent 8023b07408
commit f8b61c27d3
+3 -1
View File
@@ -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);
}