aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/mm
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-05-12 00:04:48 -0400
committerDavid S. Miller <davem@davemloft.net>2008-05-12 00:04:48 -0400
commita94a172d6c826232e623160ae134abbce181a41f (patch)
tree2e2bfde5fa2b29ad7854b75248195caf2b9253f7 /arch/sparc64/mm
parent8bf3028ede10dfe22e1729ebad96f6eb77020712 (diff)
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 <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/mm')
-rw-r--r--arch/sparc64/mm/init.c16
1 files changed, 11 insertions, 5 deletions
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)
610 610
611static void __init inherit_prom_mappings(void) 611static void __init inherit_prom_mappings(void)
612{ 612{
613 read_obp_translations();
614
615 /* Now fixup OBP's idea about where we really are mapped. */ 613 /* Now fixup OBP's idea about where we really are mapped. */
616 printk("Remapping the kernel... "); 614 printk("Remapping the kernel... ");
617 remap_kernel(); 615 remap_kernel();
@@ -1747,7 +1745,17 @@ void __init paging_init(void)
1747 1745
1748 lmb_init(); 1746 lmb_init();
1749 1747
1750 /* Find available physical memory... */ 1748 /* Find available physical memory...
1749 *
1750 * Read it twice in order to work around a bug in openfirmware.
1751 * The call to grab this table itself can cause openfirmware to
1752 * allocate memory, which in turn can take away some space from
1753 * the list of available memory. Reading it twice makes sure
1754 * we really do get the final value.
1755 */
1756 read_obp_translations();
1757 read_obp_memory("reg", &pall[0], &pall_ents);
1758 read_obp_memory("available", &pavail[0], &pavail_ents);
1751 read_obp_memory("available", &pavail[0], &pavail_ents); 1759 read_obp_memory("available", &pavail[0], &pavail_ents);
1752 1760
1753 phys_base = 0xffffffffffffffffUL; 1761 phys_base = 0xffffffffffffffffUL;
@@ -1788,8 +1796,6 @@ void __init paging_init(void)
1788 1796
1789 inherit_prom_mappings(); 1797 inherit_prom_mappings();
1790 1798
1791 read_obp_memory("reg", &pall[0], &pall_ents);
1792
1793 init_kpte_bitmap(); 1799 init_kpte_bitmap();
1794 1800
1795 /* Ok, we can use our TLB miss and window trap handlers safely. */ 1801 /* Ok, we can use our TLB miss and window trap handlers safely. */