Re: minimum guaranteed alignment of dma_alloc_coherent?

2011-03-28 Thread Benjamin Herrenschmidt
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

Re: minimum guaranteed alignment of dma_alloc_coherent?

2011-02-07 Thread Timur Tabi
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

Re: minimum guaranteed alignment of dma_alloc_coherent?

2011-02-04 Thread Dan Malek
On Feb 4, 2011, at 6:04 PM, Tabi Timur-B04825 wrote: I guess I'm not clear. I was wondering why an API called "dma_alloc_coherent" (that has the word "dma" in it) needs to be told to allocate DMA-safe memory. I understood your question, and I indicated this is used in a platform specific

Re: minimum guaranteed alignment of dma_alloc_coherent?

2011-02-04 Thread Tabi Timur-B04825
Dan Malek wrote: > > >> On a side note, do I really need to pass GFP_DMA > > The GFP_DMA is architecture dependent. Are you writing > a driver to be used across multiple architectures? It's conceivable that the driver could work on PowerPC and ARM. > If it's > necessary, I'd document why yo

Re: minimum guaranteed alignment of dma_alloc_coherent?

2011-02-04 Thread Dan Malek
On Feb 4, 2011, at 4:14 PM, Timur Tabi wrote: Is there any official statement on what the minimum alignment is for memory returned by dma_alloc_coherent? This is dependent upon the particular implementation. There have been several over the history of this API, and some would work out of a DM

minimum guaranteed alignment of dma_alloc_coherent?

2011-02-04 Thread Timur Tabi
Is there any official statement on what the minimum alignment is for memory returned by dma_alloc_coherent? I know that since it uses a page allocator to do the actual allocation, that the memory is page aligned (at least on PowerPC). Is this something I can rely on? Would anyone have a complain