diff options
| author | Christoph Hellwig <hch@lst.de> | 2019-06-13 04:24:46 -0400 |
|---|---|---|
| committer | Michael Ellerman <mpe@ellerman.id.au> | 2019-06-19 08:31:20 -0400 |
| commit | 9739ab7eda459f0669ec9807e0d9be5020bab88c (patch) | |
| tree | 8c47ef74097699cd4dd4d53bebf10a8ccbb7610d | |
| parent | 84b028243ef07a3f65c1857343ada2b1022f8bed (diff) | |
powerpc: enable a 30-bit ZONE_DMA for 32-bit pmac
With the strict dma mask checking introduced with the switch to
the generic DMA direct code common wifi chips on 32-bit powerbooks
stopped working. Add a 30-bit ZONE_DMA to the 32-bit pmac builds
to allow them to reliably allocate dma coherent memory.
Fixes: 65a21b71f948 ("powerpc/dma: remove dma_nommu_dma_supported")
Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
| -rw-r--r-- | arch/powerpc/include/asm/page.h | 7 | ||||
| -rw-r--r-- | arch/powerpc/mm/mem.c | 3 | ||||
| -rw-r--r-- | arch/powerpc/platforms/powermac/Kconfig | 1 |
3 files changed, 10 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h index dbc8c0679480..3d013e4696e9 100644 --- a/arch/powerpc/include/asm/page.h +++ b/arch/powerpc/include/asm/page.h | |||
| @@ -323,6 +323,13 @@ struct vm_area_struct; | |||
| 323 | #endif /* __ASSEMBLY__ */ | 323 | #endif /* __ASSEMBLY__ */ |
| 324 | #include <asm/slice.h> | 324 | #include <asm/slice.h> |
| 325 | 325 | ||
| 326 | /* | ||
| 327 | * Allow 30-bit DMA for very limited Broadcom wifi chips on many powerbooks. | ||
| 328 | */ | ||
| 329 | #ifdef CONFIG_PPC32 | ||
| 330 | #define ARCH_ZONE_DMA_BITS 30 | ||
| 331 | #else | ||
| 326 | #define ARCH_ZONE_DMA_BITS 31 | 332 | #define ARCH_ZONE_DMA_BITS 31 |
| 333 | #endif | ||
| 327 | 334 | ||
| 328 | #endif /* _ASM_POWERPC_PAGE_H */ | 335 | #endif /* _ASM_POWERPC_PAGE_H */ |
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index e885fe2aafcc..40bd4153ab09 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
| @@ -253,7 +253,8 @@ void __init paging_init(void) | |||
| 253 | (long int)((top_of_ram - total_ram) >> 20)); | 253 | (long int)((top_of_ram - total_ram) >> 20)); |
| 254 | 254 | ||
| 255 | #ifdef CONFIG_ZONE_DMA | 255 | #ifdef CONFIG_ZONE_DMA |
| 256 | max_zone_pfns[ZONE_DMA] = min(max_low_pfn, 0x7fffffffUL >> PAGE_SHIFT); | 256 | max_zone_pfns[ZONE_DMA] = min(max_low_pfn, |
| 257 | ((1UL << ARCH_ZONE_DMA_BITS) - 1) >> PAGE_SHIFT); | ||
| 257 | #endif | 258 | #endif |
| 258 | max_zone_pfns[ZONE_NORMAL] = max_low_pfn; | 259 | max_zone_pfns[ZONE_NORMAL] = max_low_pfn; |
| 259 | #ifdef CONFIG_HIGHMEM | 260 | #ifdef CONFIG_HIGHMEM |
diff --git a/arch/powerpc/platforms/powermac/Kconfig b/arch/powerpc/platforms/powermac/Kconfig index f834a19ed772..c02d8c503b29 100644 --- a/arch/powerpc/platforms/powermac/Kconfig +++ b/arch/powerpc/platforms/powermac/Kconfig | |||
| @@ -7,6 +7,7 @@ config PPC_PMAC | |||
| 7 | select PPC_INDIRECT_PCI if PPC32 | 7 | select PPC_INDIRECT_PCI if PPC32 |
| 8 | select PPC_MPC106 if PPC32 | 8 | select PPC_MPC106 if PPC32 |
| 9 | select PPC_NATIVE | 9 | select PPC_NATIVE |
| 10 | select ZONE_DMA if PPC32 | ||
| 10 | default y | 11 | default y |
| 11 | 12 | ||
| 12 | config PPC_PMAC64 | 13 | config PPC_PMAC64 |
