]> Pileus Git - ~andy/linux/commitdiff
powerpc: Fix memory limits when starting at a non-zero address
authorScott Wood <scottwood@freescale.com>
Thu, 27 Jan 2011 10:30:44 +0000 (10:30 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 2 Mar 2011 05:56:15 +0000 (16:56 +1100)
memblock_enforce_memory_limit() takes the desired maximum quantity of memory
to end up with, not an address above which memory will not be used.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/prom.c
arch/powerpc/mm/init_32.c

index 7185f0da7dc3eaed0220277794a54b217a9d2659..05b7139d6a27b984915f17d51ff30b70c37c21ec 100644 (file)
@@ -97,7 +97,7 @@ static void __init move_device_tree(void)
        start = __pa(initial_boot_params);
        size = be32_to_cpu(initial_boot_params->totalsize);
 
-       if ((memory_limit && (start + size) > memory_limit) ||
+       if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) ||
                        overlaps_crashkernel(start, size)) {
                p = __va(memblock_alloc(size, PAGE_SIZE));
                memcpy(p, initial_boot_params, size);
index 742da43b4ab6ddffe75f0609d4d5021bafccac25..d65b591e5556bd01a4ee4bb7b5238b43ee389f6a 100644 (file)
@@ -148,7 +148,7 @@ void __init MMU_init(void)
                lowmem_end_addr = memstart_addr + total_lowmem;
 #ifndef CONFIG_HIGHMEM
                total_memory = total_lowmem;
-               memblock_enforce_memory_limit(lowmem_end_addr);
+               memblock_enforce_memory_limit(total_lowmem);
                memblock_analyze();
 #endif /* CONFIG_HIGHMEM */
        }