Re: [PATCH] e100: Add missing dma sync for proper operation with non-coherent caches.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Acker wrote:
David Daney wrote:

diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 19d32a2..fb8d551 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -1840,6 +1840,11 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx, if (readb(&nic->csr->scb.status) & rus_no_res)
                 nic->ru_running = RU_SUSPENDED;
+        /* We are done looking at the buffer.  Prepare it for
+         * more DMA.  */
+        pci_dma_sync_single_for_device(nic->pdev, rx->dma_addr,
+                           sizeof(struct rfd),
+                           PCI_DMA_FROMDEVICE);
         return -ENODATA;
     }
Should the call to pci_dma_sync_single_for_device be DMA_TO_DEVICE since we are giving the memory back to the device?

No. We are giving the memory back to the device, but the direction of the data transfer is from the device to memory.

David Daney


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux