diff options
author | Will Deacon <will.deacon@arm.com> | 2012-11-12 19:19:35 +0000 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2012-11-14 09:54:15 +0000 |
commit | 938edf5c04202b59b8ff01a4033e9413646b105b (patch) | |
tree | 794affc77e1b5dc33d2e99f0e5ebaefaf5e16994 /arch/arm64 | |
parent | 3495386b107510ba7014f42da37034648c1d2cfd (diff) | |
download | linux-938edf5c04202b59b8ff01a4033e9413646b105b.tar.gz linux-938edf5c04202b59b8ff01a4033e9413646b105b.tar.bz2 linux-938edf5c04202b59b8ff01a4033e9413646b105b.zip |
arm64: mm: update max_dma32 before calculating size of NORMAL zone
Commit f483a853b0b9 ("arm64: mm: fix booting on systems with no memory
below 4GB") sets max_dma32 to the minimum of the maximum pfn and
MAX_DMA32_PFN. This value is later used as the base of the NORMAL zone,
which is incorrect when MAX_DMA32_PFN is below the minimum pfn (i.e. all
memory is above 4GB).
This patch fixes the problem by ensuring that max_dma32 is always set to
the end of the DMA32 zone.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/mm/init.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 4cd28931dba9..800aac306a08 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -79,8 +79,8 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) #ifdef CONFIG_ZONE_DMA32 /* 4GB maximum for 32-bit only capable devices */ - max_dma32 = min(max, MAX_DMA32_PFN); - zone_size[ZONE_DMA32] = max(min, max_dma32) - min; + max_dma32 = max(min, min(max, MAX_DMA32_PFN)); + zone_size[ZONE_DMA32] = max_dma32 - min; #endif zone_size[ZONE_NORMAL] = max - max_dma32; |