Skip to content

Commit 9739ab7

Browse files
Christoph Hellwigmpe
authored andcommitted
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: 65a21b7 ("powerpc/dma: remove dma_nommu_dma_supported") Reported-by: Aaro Koskinen <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Tested-by: Larry Finger <[email protected]> Acked-by: Larry Finger <[email protected]> Tested-by: Aaro Koskinen <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 84b0282 commit 9739ab7

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

arch/powerpc/include/asm/page.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,13 @@ struct vm_area_struct;
323323
#endif /* __ASSEMBLY__ */
324324
#include <asm/slice.h>
325325

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
326332
#define ARCH_ZONE_DMA_BITS 31
333+
#endif
327334

328335
#endif /* _ASM_POWERPC_PAGE_H */

arch/powerpc/mm/mem.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ void __init paging_init(void)
253253
(long int)((top_of_ram - total_ram) >> 20));
254254

255255
#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);
257258
#endif
258259
max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
259260
#ifdef CONFIG_HIGHMEM

arch/powerpc/platforms/powermac/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ config PPC_PMAC
77
select PPC_INDIRECT_PCI if PPC32
88
select PPC_MPC106 if PPC32
99
select PPC_NATIVE
10+
select ZONE_DMA if PPC32
1011
default y
1112

1213
config PPC_PMAC64

0 commit comments

Comments
 (0)