diff options
author | Tejun Heo <tj@kernel.org> | 2011-12-08 13:22:07 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-12-08 13:22:07 -0500 |
commit | 6fbef13c4feaf0c5576e2315f4d2999c4b670c88 (patch) | |
tree | 454bc9c67bf92295595130f4d42548b6d59b5474 /arch/powerpc/kernel/prom.c | |
parent | c0ce8fef55896a2813a3d94e1b2d0e6d7fab6228 (diff) |
powerpc: Cleanup memblock usage
* early_init_devtree(): Total memory size is aligned to PAGE_SIZE;
however, alignment isn't enforced if memory_limit is explicitly
specified. Simplify the logic and always apply PAGE_SIZE alignment.
* MMU_init(): memblock regions is truncated by directly modifying
memblock.memory.cnt. This is incomplete (reserved array is not
truncated) and unnecessarily low level hindering further memblock
improvments. Use memblock_enforce_memory_limit() instead.
* wii_memory_fixups(): Unnecessarily low level direct manipulation of
memblock regions. The same result can be achieved using properly
abstracted operations. Reimplement using memblock API.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Diffstat (limited to 'arch/powerpc/kernel/prom.c')
-rw-r--r-- | arch/powerpc/kernel/prom.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index a7ee83e6eb17..28500d4f29d9 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -754,17 +754,12 @@ void __init early_init_devtree(void *params) | |||
754 | early_reserve_mem(); | 754 | early_reserve_mem(); |
755 | phyp_dump_reserve_mem(); | 755 | phyp_dump_reserve_mem(); |
756 | 756 | ||
757 | limit = memory_limit; | 757 | /* |
758 | if (! limit) { | 758 | * Ensure that total memory size is page-aligned, because otherwise |
759 | phys_addr_t memsize; | 759 | * mark_bootmem() gets upset. |
760 | 760 | */ | |
761 | /* Ensure that total memory size is page-aligned, because | 761 | memblock_analyze(); |
762 | * otherwise mark_bootmem() gets upset. */ | 762 | limit = ALIGN(memory_limit ?: memblock_phys_mem_size(), PAGE_SIZE); |
763 | memblock_analyze(); | ||
764 | memsize = memblock_phys_mem_size(); | ||
765 | if ((memsize & PAGE_MASK) != memsize) | ||
766 | limit = memsize & PAGE_MASK; | ||
767 | } | ||
768 | memblock_enforce_memory_limit(limit); | 763 | memblock_enforce_memory_limit(limit); |
769 | 764 | ||
770 | memblock_analyze(); | 765 | memblock_analyze(); |