]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
powerpc: Change memory_limit from phys_addr_t to unsigned long long
authorSuzuki Poulose <suzuki@in.ibm.com>
Tue, 21 Aug 2012 01:42:33 +0000 (01:42 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 7 Sep 2012 01:44:30 +0000 (11:44 +1000)
There are some device-tree nodes, whose values are of type phys_addr_t.
The phys_addr_t is variable sized based on the CONFIG_PHSY_T_64BIT.

Change these to a fixed unsigned long long for consistency.

This patch does the change only for memory_limit.

The following is a list of such variables which need the change:

 1) kernel_end, crashk_size - in arch/powerpc/kernel/machine_kexec.c

 2) (struct resource *)crashk_res.start - We could export a local static
    variable from machine_kexec.c.

Changing the above values might break the kexec-tools. So, I will
fix kexec-tools first to handle the different sized values and then change
 the above.

Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Suzuki K. Poulose <suzuki@in.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/setup.h
arch/powerpc/kernel/fadump.c
arch/powerpc/kernel/machine_kexec.c
arch/powerpc/kernel/prom.c
arch/powerpc/mm/mem.c

index d084ce195fc3af11b6c37443ae3ecc37c59fa3d4..8b9a306260b2cf7c7bc664d09ba2926bc1ac6dda 100644 (file)
@@ -9,7 +9,7 @@ extern void ppc_printk_progress(char *s, unsigned short hex);
 extern unsigned int rtas_data;
 extern int mem_init_done;      /* set on boot once kmalloc can be called */
 extern int init_bootmem_done;  /* set once bootmem is available */
-extern phys_addr_t memory_limit;
+extern unsigned long long memory_limit;
 extern unsigned long klimit;
 extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
 
index 18bdf74fa164042e0e3b07a7dd0867faf8d6069c..06c8202a69cf43a1689a8a98323d398872f80df1 100644 (file)
@@ -289,8 +289,7 @@ int __init fadump_reserve_mem(void)
                else
                        memory_limit = memblock_end_of_DRAM();
                printk(KERN_INFO "Adjusted memory_limit for firmware-assisted"
-                               " dump, now %#016llx\n",
-                               (unsigned long long)memory_limit);
+                               " dump, now %#016llx\n", memory_limit);
        }
        if (memory_limit)
                memory_boundary = memory_limit;
index 5df777794403d49a3820add9ba6409701b295da4..4074eff1e74490da61a1d562a684e19a17c74534 100644 (file)
@@ -165,7 +165,7 @@ void __init reserve_crashkernel(void)
        if (memory_limit && memory_limit <= crashk_res.end) {
                memory_limit = crashk_res.end + 1;
                printk("Adjusted memory limit for crashkernel, now 0x%llx\n",
-                      (unsigned long long)memory_limit);
+                      memory_limit);
        }
 
        printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
index f191bf02943a839dc243e0b9dcbbabe8f874eff1..37725e86651e99bcce696665ba7199fad3445363 100644 (file)
@@ -78,7 +78,7 @@ static int __init early_parse_mem(char *p)
                return 1;
 
        memory_limit = PAGE_ALIGN(memparse(p, &p));
-       DBG("memory limit = 0x%llx\n", (unsigned long long)memory_limit);
+       DBG("memory limit = 0x%llx\n", memory_limit);
 
        return 0;
 }
@@ -661,7 +661,7 @@ void __init early_init_devtree(void *params)
 
        /* make sure we've parsed cmdline for mem= before this */
        if (memory_limit)
-               first_memblock_size = min(first_memblock_size, memory_limit);
+               first_memblock_size = min_t(u64, first_memblock_size, memory_limit);
        setup_initial_memory_limit(memstart_addr, first_memblock_size);
        /* Reserve MEMBLOCK regions used by kernel, initrd, dt, etc... */
        memblock_reserve(PHYSICAL_START, __pa(klimit) - PHYSICAL_START);
index fbdad0e3929a8ddfbcb0f714a6480f0ca33ba6f6..44cf2b20503da71f491177ac5252664ea200c498 100644 (file)
@@ -62,7 +62,7 @@
 
 int init_bootmem_done;
 int mem_init_done;
-phys_addr_t memory_limit;
+unsigned long long memory_limit;
 
 #ifdef CONFIG_HIGHMEM
 pte_t *kmap_pte;