On Mon, 2008-10-06 at 11:30 -0500, Scott Wood wrote: > Remi Machet wrote: > > After continuing to work on the dma noncoherent code I realized that > > sync_page is not the best choice of API: > > -The API should preferably take a dma_addr_t in my opinion > > A virtual address will typically be needed to perform the flush; why > pass the bus address? Because it is a sync API. You want to make sure that a physical memory area is in sync with the caches, not the virtual address. This distinction can become important in the event where the page is mapped multiple times in the memory and the architecture does not take care of synchronizing the multiple mapping, the dma_mapping_ops code should be able to synchronize the multiple mapping. In most case it would be easy of course to go from virtual address to the page address, but not if the page is in high memory ...
By the way I realized later on that scatter/gather structures contain 2 fields: dma_addr and dma_length that can be used to recover the bus address => no need for sync_sg anymore. Remi _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev