[PATCH 4/5] DMA: Add functions to preallocate DMA memory dor devices

Russell King - ARM Linux linux at arm.linux.org.uk
Thu Sep 2 06:50:55 EDT 2010


On Thu, Aug 19, 2010 at 04:40:22PM +0200, Guennadi Liakhovetski wrote:
> Currently dma_declare_coherent_memory() and dma_release_declared_memory() are
> provided to assign DMA memory to a device and to release it. These functions
> can be use with device local memory, like on-chip SRAM. However, they are
> unsuitable for assigning of generic system RAM to devices, because such system
> memory should not be ioremapped, and ioremap() is used internally in the former
> of these functions to map the memory.
> 
> This patch solves this problem by adding two more functions:
> dma_preallocate_coherent_memory() and dma_release_preallocated_memory(), which
> allocate DMA coherent memory and assign it to the device, and release it back
> respectively.

This looks like a much saner interface for pre-allocating DMA memory from
system memory, rather than trying to use dma_declare_coherent_memory().

Acked-by: Russell King <rmk+kernel at arm.linux.org.uk>



More information about the linux-arm-kernel mailing list