aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/mm
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2010-10-12 17:07:09 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2010-10-12 18:37:51 -0400
commitc7fc2de0c83dbd2eaf759c5cd0e2b9cf1eb4df3a (patch)
treec4413e9b3bc164394c2daccf34e18e0b1d6c8811 /arch/sparc/mm
parent8e4029ee3517084ae00fbfbcb51cc365d8857061 (diff)
memblock, bootmem: Round pfn properly for memory and reserved regions
We need to round memory regions correctly -- specifically, we need to round reserved region in the more expansive direction (lower limit down, upper limit up) whereas usable memory regions need to be rounded in the more restrictive direction (lower limit up, upper limit down). This introduces two set of inlines: memblock_region_memory_base_pfn() memblock_region_memory_end_pfn() memblock_region_reserved_base_pfn() memblock_region_reserved_end_pfn() Although they are antisymmetric (and therefore are technically duplicates) the use of the different inlines explicitly documents the programmer's intention. The lack of proper rounding caused a bug on ARM, which was then found to also affect other architectures. Reported-by: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Yinghai Lu <yinghai@kernel.org> LKML-Reference: <4CB4CDFD.4020105@kernel.org> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/sparc/mm')
-rw-r--r--arch/sparc/mm/init_64.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index dc584d26d597..4c2572773b55 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -1294,8 +1294,8 @@ static void __init bootmem_init_nonnuma(void)
1294 if (!reg->size) 1294 if (!reg->size)
1295 continue; 1295 continue;
1296 1296
1297 start_pfn = memblock_region_base_pfn(reg); 1297 start_pfn = memblock_region_memory_base_pfn(reg);
1298 end_pfn = memblock_region_end_pfn(reg); 1298 end_pfn = memblock_region_memory_end_pfn(reg);
1299 add_active_range(0, start_pfn, end_pfn); 1299 add_active_range(0, start_pfn, end_pfn);
1300 } 1300 }
1301 1301