summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2014-08-08 18:40:44 -0500
committerScott Wood <scottwood@freescale.com>2014-09-03 17:58:22 -0500
commitcf5621032fbe7354c0c3fff17958b7029bbc9f30 (patch)
tree4500f41857757277438950e22d5950c4ae3a3784 /arch/powerpc/kernel
parent6397fc3fb05e73062b9790cfe2760e209ebd7b95 (diff)
downloadop-kernel-dev-cf5621032fbe7354c0c3fff17958b7029bbc9f30.zip
op-kernel-dev-cf5621032fbe7354c0c3fff17958b7029bbc9f30.tar.gz
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 <scottwood@freescale.com> Cc: Shaohui Xie <Shaohui.Xie@freescale.com>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/dma-swiotlb.c8
1 files changed, 6 insertions, 2 deletions
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)
OpenPOWER on IntegriCloud