login
Header Space

 
 

Re: dma_alloc_coherent() on PPC32: physical addresses above 2G possible?

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Stefan Richter <stefanr@...>
Cc: <linuxppc-dev@...>, <linux-kernel@...>
Date: Sunday, July 20, 2008 - 5:35 pm

On Sun, 2008-07-20 at 20:36 +0200, Stefan Richter wrote:

CONFIG_PPC32 -may- be safe today... the  current implementation
for DMA coherent machines seem to have been copied from x86 or so :-) It
sets GFP_DMA if the coherent_dma_mask < 32 bits, but we don't have
separate ZONE_NORMAL and ZONE_DMA anyway, so that is irrelevant. In any
case, it won't give you memory in highmem, so you should be safe.

In the  non-DMA coherent case, make sure you don't pass __GFP_HIGHMEM.

There's some work in progress to support swiotlb and more advanced DMA
mapping ops for PPC32 (using function pointers like PPC64), so things
will probably change. However, the need for 31 bits DMA seem to be
common enough that we should probably do something specific about it,
for example, ensure that lowmem is never > 2G (shouldn't be a big deal)
and thus make dma masks < 32 bits always clear __GFP_HIGHMEM from the
allocation mask.

Ben.


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: dma_alloc_coherent() on PPC32: physical addresses above ..., Benjamin Herrenschmidt, (Sun Jul 20, 5:35 pm)
speck-geostationary