From 6ec03868f1a8f250c8426d092ca5e4f799563fc2 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sun, 11 May 2008 21:04:48 -0700 Subject: [PATCH] --- yaml --- r: 96399 b: refs/heads/master c: a94a172d6c826232e623160ae134abbce181a41f h: refs/heads/master i: 96397: e1a6439b09d3102b67b39e8fbdb5fd440db6f38d 96395: c6428a7cc94c31f29146f2614ec33dc68343f2a5 96391: 50fe666ef5d2fda3f210164224e5cd369fee9565 96383: 1fe475226050a2aa9ba39e24fd23f53726a6b26c v: v3 --- [refs] | 2 +- trunk/arch/sparc64/mm/init.c | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index b48aafa262ff..b3d9e56f4ebb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8bf3028ede10dfe22e1729ebad96f6eb77020712 +refs/heads/master: a94a172d6c826232e623160ae134abbce181a41f diff --git a/trunk/arch/sparc64/mm/init.c b/trunk/arch/sparc64/mm/init.c index ec3e2c72302a..a9828d748e2c 100644 --- a/trunk/arch/sparc64/mm/init.c +++ b/trunk/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. */