From: Scott Wood Date: Fri, 8 Aug 2014 23:40:44 +0000 (-0500) Subject: powerpc/64: Limit ZONE_DMA32 to 4GiB in swiotlb_detect_4g() X-Git-Tag: v4.14-rc1~6606^2~44^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf5621032fbe7354c0c3fff17958b7029bbc9f30;p=platform%2Fkernel%2Flinux-rpi.git powerpc/64: Limit ZONE_DMA32 to 4GiB in swiotlb_detect_4g() A DMA zone is still needed with swiotlb, for coherent allocations. This doesn't affect platforms that don't use swiotlb or that don't call swiotlb_detect_4g(). Signed-off-by: Scott Wood Cc: Shaohui Xie --- diff --git a/arch/powerpc/kernel/dma-swiotlb.c b/arch/powerpc/kernel/dma-swiotlb.c index bd1a2ab..7359797 100644 --- a/arch/powerpc/kernel/dma-swiotlb.c +++ b/arch/powerpc/kernel/dma-swiotlb.c @@ -106,10 +106,14 @@ int __init swiotlb_setup_bus_notifier(void) return 0; } -void swiotlb_detect_4g(void) +void __init swiotlb_detect_4g(void) { - if ((memblock_end_of_DRAM() - 1) > 0xffffffff) + if ((memblock_end_of_DRAM() - 1) > 0xffffffff) { ppc_swiotlb_enable = 1; +#ifdef CONFIG_ZONE_DMA32 + limit_zone_pfn(ZONE_DMA32, (1ULL << 32) >> PAGE_SHIFT); +#endif + } } static int __init swiotlb_late_init(void)