minimum guaranteed alignment of dma_alloc_coherent?

Benjamin Herrenschmidt benh at kernel.crashing.org
Tue Mar 29 11:32:39 EST 2011


On Mon, 2011-02-07 at 09:13 -0600, Timur Tabi wrote:
> > This behavior is modified if you specify a restricted DMA
> > mask for the device.  In this case, dma_alloc_coherent
> > will force GFP_DMA on your behalf (on PowerPC).
> 
> Isn't it required for all callers of dma_alloc_coherent to specify a
> mask (via
> dma_set_mask) first?

GFP_DMA historically means ISA DMA memory on x86 :-) Other platforms had
different "use" for it but basically it's old style drivers.

The problem with dma_set_mask() is that there's no way without an iommu
that the implementation of dma_alloc_coherent() can satisfy arbitrary
masks since you don't control where the page allocator gets you the
pages from ... unless you have zones. That's what ZONE_DMA and
ZONE_DMA32 are for.

Cheers,
Ben.




More information about the Linuxppc-dev mailing list