Skip to contentSkip to conversation

dma_sync_to_device

PATCH James Bottomley 3 participants 4 messages Feb 13, 2004 – Feb 14, 2004

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
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

#2 lore raw
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 to sync_to_device which 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_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?

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