On Tue, 27 Jul 2010 06:58:42 -0600 Jonathan Corbet <corbet@xxxxxxx> wrote: > On Tue, 27 Jul 2010 14:45:58 +0200 > Marek Szyprowski <m.szyprowski@xxxxxxxxxxx> wrote: > > > > How does one obtain the CPU address of this memory in order for the CPU > > > to access it? > > > > Right, we did not cover such case. In CMA approach we tried to separate > > memory allocation from the memory mapping into user/kernel space. Mapping > > a buffer is much more complicated process that cannot be handled in a > > generic way, so we decided to leave this for the device drivers. Usually > > video processing devices also don't need in-kernel mapping for such > > buffers at all. > > Still...that *is* why I suggested an interface which would return both > the DMA address and a kernel-space virtual address, just like the DMA > API does... Either that, or just return the void * kernel address and The DMA API for coherent memory (dma_alloc_coherent) returns both an DMA address and a kernel-space virtual address because it does both allocation and mapping. However, other DMA API (dma_map_*) returns only an DMA address because it does only mapping. I think that if we need new API for coherent memory, we could unify it with the DMA API for coherent memory. IMO, it's cleaner to having two separate APIs for allocation and mapping (except for coherent memory). The drivers have been working in that way. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxxx For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>