From a94a172d6c826232e623160ae134abbce181a41f Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sun, 11 May 2008 21:04:48 -0700 Subject: sparc64: Work around memory probing bug in openfirmware. Read all of the OF memory and translation tables, then read the physical available memory list twice. When making these requests, OF can allocate more memory to do it's job, which can remove pages from the available memory list. So fetch in all of the tables at once, and fetch the available list last to make sure we read a stable value. Signed-off-by: David S. Miller --- arch/sparc64/mm/init.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'arch/sparc64/mm/init.c') diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index ec3e2c72302a..a9828d748e2c 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c @@ -610,8 +610,6 @@ static void __init remap_kernel(void) static void __init inherit_prom_mappings(void) { - read_obp_translations(); - /* Now fixup OBP's idea about where we really are mapped. */ printk("Remapping the kernel... "); remap_kernel(); @@ -1747,7 +1745,17 @@ void __init paging_init(void) lmb_init(); - /* Find available physical memory... */ + /* Find available physical memory... + * + * Read it twice in order to work around a bug in openfirmware. + * The call to grab this table itself can cause openfirmware to + * allocate memory, which in turn can take away some space from + * the list of available memory. Reading it twice makes sure + * we really do get the final value. + */ + read_obp_translations(); + read_obp_memory("reg", &pall[0], &pall_ents); + read_obp_memory("available", &pavail[0], &pavail_ents); read_obp_memory("available", &pavail[0], &pavail_ents); phys_base = 0xffffffffffffffffUL; @@ -1788,8 +1796,6 @@ void __init paging_init(void) inherit_prom_mappings(); - read_obp_memory("reg", &pall[0], &pall_ents); - init_kpte_bitmap(); /* Ok, we can use our TLB miss and window trap handlers safely. */ -- cgit v1.2.3 From 7047901ec7d6eca97cf66f54b8a4197bb0754f40 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Wed, 14 May 2008 23:10:33 -0700 Subject: sparc64: Fix lmb_reserve() args in find_ramdisk(). This fixes the missing ram regression reported by Mikael Pettersson , much thanks for all of this help in diagnosing this. The second argument to lmb_reserve() is a size, not an end address bounds. Tested-by: Mikael Pettersson Signed-off-by: David S. Miller --- arch/sparc64/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/sparc64/mm/init.c') diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index a9828d748e2c..3c7b9471eafb 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c @@ -768,7 +768,7 @@ static void __init find_ramdisk(unsigned long phys_base) initrd_start = ramdisk_image; initrd_end = ramdisk_image + sparc_ramdisk_size; - lmb_reserve(initrd_start, initrd_end); + lmb_reserve(initrd_start, sparc_ramdisk_size); initrd_start += PAGE_OFFSET; initrd_end += PAGE_OFFSET; -- cgit v1.2.3 From b00dc8376465ee5f8dd49b95924e31b4c2404ab0 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 19 May 2008 16:52:27 -0700 Subject: sparc64: remove CVS keywords This patch removes the CVS keywords that weren't updated for a long time from comments. Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- arch/sparc64/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/sparc64/mm/init.c') diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index 3c7b9471eafb..84898c44dd4d 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c @@ -1,4 +1,4 @@ -/* $Id: init.c,v 1.209 2002/02/09 19:49:31 davem Exp $ +/* * arch/sparc64/mm/init.c * * Copyright (C) 1996-1999 David S. Miller (davem@caip.rutgers.edu) -- cgit v1.2.3