]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mt76: fix rx dma ring descriptor state on reset
authorFelix Fietkau <nbd@nbd.name>
Thu, 5 Dec 2019 16:32:41 +0000 (17:32 +0100)
committerFelix Fietkau <nbd@nbd.name>
Fri, 14 Feb 2020 09:06:00 +0000 (10:06 +0100)
To avoid having the hardware potentially write to memory behind stale
descriptors, set the dma-done flag on all of them before cleaning up
allocated rx buffers

Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/dma.c

index f88d017ff9876c53bc9cf02f83ab956a90e8fa30..2298a4e919436448a218a203f0b6f9f23a53a387 100644 (file)
@@ -437,7 +437,7 @@ mt76_dma_rx_reset(struct mt76_dev *dev, enum mt76_rxq_id qid)
        int i;
 
        for (i = 0; i < q->ndesc; i++)
-               q->desc[i].ctrl &= ~cpu_to_le32(MT_DMA_CTL_DMA_DONE);
+               q->desc[i].ctrl cpu_to_le32(MT_DMA_CTL_DMA_DONE);
 
        mt76_dma_rx_cleanup(dev, q);
        mt76_dma_sync_idx(dev, q);