Re: [Patch] dma_sync_to_device

From: Deepak Saxena
Date: Wed Feb 11 2004 - 22:47:15 EST


On Feb 11 2004, at 11:08, David S. Miller was caught saying:
> New sequence:
>
> 1) pci_map_single(..., DMA_TO_DEVICE). Flush dirty data from cpu caches to memory,
> so device may see it.
>
> 2) device reads buffer
>
> 3) pci_dma_sync_single(... DMA_TO_DEVICE). If PCI controller has caches, flush them.
>
> 4) CPU writes new buffer data.
>
> 5) pci_dma_sync_device_single(... DMA_TO_DEVICE). Like #1, flush dirty data from cpu
> caches to memory.
>
> 6) Device reads buffer.
>
> Still disagree? :-)

/me groks now. I am assuming this is a 2.7 thing as it is
reinterpreting/redefining the API. In ARM, pci_dma_sync_single() does
a cache flush, which is why I was confused asked about two cache flushes.
What you are proposing is that by definition pci_dma_sync_* syncs
bridges caches with system memory, while pci_dma_sync_device_* syncs
the CPU's cache with system memory.

This will definetely confuse a lot of driver writers.

~Deepak

--
Deepak Saxena - dsaxena at plexity dot net - http://www.plexity.net/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/