powerpc: use the generic dma coherent remap allocator
This switches to using common code for the DMA allocations, including potential use of the CMA allocator if configured. Switching to the generic code enables DMA allocations from atomic context, which is required by the DMA API documentation, and also adds various other minor features drivers start relying upon. It also makes sure we have on tested code base for all architectures that require uncached pte bits for coherent DMA allocations. Another advantage is that consistent memory allocations now share the general vmalloc pool instead of needing an explicit careout from it. Signed-off-by: Christoph Hellwig <hch@lst.de> Tested-by: Christophe Leroy <christophe.leroy@c-s.fr> # tested on 8xx Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20190814132230.31874-2-hch@lst.de
This commit is contained in:

committed by
Michael Ellerman

parent
555e28179d
commit
f2902a2fb4
@@ -148,21 +148,15 @@ int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot);
|
||||
*/
|
||||
#include <asm/fixmap.h>
|
||||
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
#define KVIRT_TOP PKMAP_BASE
|
||||
#else
|
||||
#define KVIRT_TOP FIXADDR_START
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ioremap_bot starts at that address. Early ioremaps move down from there,
|
||||
* until mem_init() at which point this becomes the top of the vmalloc
|
||||
* and ioremap space
|
||||
*/
|
||||
#ifdef CONFIG_NOT_COHERENT_CACHE
|
||||
#define IOREMAP_TOP ((KVIRT_TOP - CONFIG_CONSISTENT_SIZE) & PAGE_MASK)
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
#define IOREMAP_TOP PKMAP_BASE
|
||||
#else
|
||||
#define IOREMAP_TOP KVIRT_TOP
|
||||
#define IOREMAP_TOP FIXADDR_START
|
||||
#endif
|
||||
|
||||
/* PPC32 shares vmalloc area with ioremap */
|
||||
|
@@ -76,21 +76,15 @@ int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot);
|
||||
*/
|
||||
#include <asm/fixmap.h>
|
||||
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
#define KVIRT_TOP PKMAP_BASE
|
||||
#else
|
||||
#define KVIRT_TOP FIXADDR_START
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ioremap_bot starts at that address. Early ioremaps move down from there,
|
||||
* until mem_init() at which point this becomes the top of the vmalloc
|
||||
* and ioremap space
|
||||
*/
|
||||
#ifdef CONFIG_NOT_COHERENT_CACHE
|
||||
#define IOREMAP_TOP ((KVIRT_TOP - CONFIG_CONSISTENT_SIZE) & PAGE_MASK)
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
#define IOREMAP_TOP PKMAP_BASE
|
||||
#else
|
||||
#define IOREMAP_TOP KVIRT_TOP
|
||||
#define IOREMAP_TOP FIXADDR_START
|
||||
#endif
|
||||
|
||||
/* PPC32 shares vmalloc area with ioremap */
|
||||
|
Reference in New Issue
Block a user