Thread (6 messages) 6 messages, 4 authors, 2011-03-29

Re: minimum guaranteed alignment of dma_alloc_coherent?

flat view

From: Timur Tabi <hidden>
Date: 2011-02-07 15:29:10

Dan Malek wrote:
So, I did a little research.  It appears in the case of PowerPC,
the GFP_DMA can change the way the allocation operates.
Since the coherent allocator works with pages of memory,
in the case of a system with highmem, not using GFP_DMA
could hand you a physical page out of the highmem pool.
I think that's true only if SWIOTLB is enabled.  dma_direct_alloc_coherent()
does this:

	/* ignore region specifiers */
	flag  &= ~(__GFP_HIGHMEM);
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?

-- 
Timur Tabi
Linux kernel developer at Freescale

-- 
Timur Tabi
Linux kernel developer at Freescale
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help