提交 9bf9fca8 编写于 作者: V Vasanthakumar Thiagarajan 提交者: John W. Linville

ath9k: Synchronize DMA transfer with CPU at right place

This patch does pci_dma_sync_single_for_cpu() before accessing
the header of the frame and queueing the same buffer into h/w.
Signed-off-by: NVasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 f7a276a6
...@@ -519,6 +519,15 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) ...@@ -519,6 +519,15 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
if (!skb) if (!skb)
continue; continue;
/*
* Synchronize the DMA transfer with CPU before
* 1. accessing the frame
* 2. requeueing the same buffer to h/w
*/
pci_dma_sync_single_for_cpu(sc->pdev, bf->bf_buf_addr,
sc->rx.bufsize,
PCI_DMA_FROMDEVICE);
/* /*
* If we're asked to flush receive queue, directly * If we're asked to flush receive queue, directly
* chain it back at the queue without processing it. * chain it back at the queue without processing it.
...@@ -547,10 +556,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) ...@@ -547,10 +556,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
if (!requeue_skb) if (!requeue_skb)
goto requeue; goto requeue;
/* Sync and unmap the frame */ /* Unmap the frame */
pci_dma_sync_single_for_cpu(sc->pdev, bf->bf_buf_addr,
sc->rx.bufsize,
PCI_DMA_FROMDEVICE);
pci_unmap_single(sc->pdev, bf->bf_buf_addr, pci_unmap_single(sc->pdev, bf->bf_buf_addr,
sc->rx.bufsize, sc->rx.bufsize,
PCI_DMA_FROMDEVICE); PCI_DMA_FROMDEVICE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册