dma_sync_to_device
Just to be sure we eliminate all confusion (and it amazes me how frequently this comes up), could you add some words DMA-mapping.txt to make clear that this new API does not address PCI posting (which is a problem with onward write cache flushing in the PCI bridge)---otherwise I can see device driver writers thinking that pci_dma_sync_to_device_single(... DMA_TO_DEVICE) will flush posted writes.
Thanks,
James
Quoted 7 lines · James Bottomley
Just to be sure we eliminate all confusion (and it amazes me how frequently this comes up), could you add some words DMA-mapping.txt to make clear that this new API does not address PCI posting (which is a problem with onward write cache flushing in the PCI bridge)---otherwise I can see device driver writers thinking that pci_dma_sync_to_device_single(...
DMA_TO_DEVICE) will flush posted writes.
Ok, will do.
Just to make sure I got you right, your concern is people mixing up the effect of this call with some means to sync with posted writes on iomem mapped memory location provided by some device on the bus? I.e. the situation where they probably want to use readl() or similar to force the posted writes to complete in contrast to sync_to_device which ensures the modified system memory gets synced before the busmastering starts?
If so, wouldn't this concern be related to the pci_dma api as a whole, not only the new pci_dma_sync_to_device call particularly? I mean, none of the api functions to deal with consistent or streaming maps of system memory are applicable for flushing posted writes to iomem on the bus. Maybe the confusion comes from the fact on some archs the pci_dma_sync call would have to flush posted writes _from_ the busmaster device to system memory?
Could you please confirm my understanding of the issue is correct (or not) before I'm trying to add some clarification to DMA-mapping.txt.
Martin
Quoted 8 lines · Martin Diehl
Ok, will do.
Just to make sure I got you right, your concern is people mixing up the effect of this call with some means to sync with posted writes on iomem mapped memory location provided by some device on the bus? I.e. the situation where they probably want to use
readl()or similar to force the posted writes to complete in contrast tosync_to_devicewhich ensures the modified system memory gets synced before the busmastering starts?
Yes, that's it.
Quoted 6 lines
If so, wouldn't this concern be related to the
pci_dmaapi as a whole, not only the newpci_dma_sync_to_devicecall particularly? I mean, none of the api functions to deal with consistent or streaming maps of system memory are applicable for flushing posted writes to iomem on the bus. Maybe the confusion comes from the fact on some archs thepci_dma_synccall would have to flush posted writes _from_ the busmaster device to system memory?
Well ... people did ask, even in the old api. The excuse always was that the cache coherency aspect deals exclusively with the CPU cache. Now you're adding an API specifically to deal with possible bus caches, I just wanted it to be crystal clear that you can't use the bus cache API for flushing posted writes.
James
Quoted 1 line · On Sat, 14 Feb 2004 09:51:17 +0100 (CET) Martin Diehl <[email protected]> wrote:
Ok, will do.
Martin, when you have an updated patch, toss it my way please and I'll work on it further.
Thanks.