[PATCH 4/5] DMA: Add functions to preallocate DMA memory dor devices
Uwe Kleine-König
u.kleine-koenig at pengutronix.de
Wed Sep 15 03:28:50 EDT 2010
Hello,
On Thu, Sep 02, 2010 at 11:50:55AM +0100, Russell King - ARM Linux wrote:
> 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>
Acked-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
If this series isn't acceptable for the DMA people, I suggest to add it
locally for ARM if no other solution is found before .36 is released.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
More information about the linux-arm-kernel
mailing list