Hi,
dma_map_xxx / dma_unmap_xxx pair are used to do cache coherency.
see Documentation/DMA-API.txt.
dma_map_xxx: "Maps a piece of processor virtual memory so it can be accessed by the device and returns the physical handle of the memory."
dma_unmap_xxx: "Unmaps the region previously mapped. All the parameters passed in must be identical to those passed in (and returned) by the mapping API."
Assuming you are doing DMA_TO_DEVICE synchronization:
cpu accesses buffer
dma_map_xxx (after this point, cpu cannot touch the buffer)
device accesses buffer
device accesses buffer
dma_unmap_xxx (after this point, device cannot touch the buffer)
cpu accesses buffer
Regards,
MH