diff options
author | David S. Miller <davem@davemloft.net> | 2008-02-13 22:20:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-24 02:32:11 -0400 |
commit | b97094560b991af5c62391014e72bfa4c3a3701f (patch) | |
tree | fbdc76cea526c0170982419717b6a3fe6a64c0f3 | |
parent | 9422273ba7d139537720c8c47514925d9a621e0d (diff) |
[SPARC64]: Call real_setup_per_cpu_areas() earlier and use lmb_alloc().
We have to do it like this before we can move the PROM and MDESC device
tree code over to using lmb_alloc().
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | arch/sparc64/kernel/smp.c | 11 | ||||
-rw-r--r-- | arch/sparc64/mm/init.c | 8 |
2 files changed, 14 insertions, 5 deletions
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index 59f020d69d4c..524b88920947 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <linux/cache.h> | 20 | #include <linux/cache.h> |
21 | #include <linux/jiffies.h> | 21 | #include <linux/jiffies.h> |
22 | #include <linux/profile.h> | 22 | #include <linux/profile.h> |
23 | #include <linux/bootmem.h> | 23 | #include <linux/lmb.h> |
24 | 24 | ||
25 | #include <asm/head.h> | 25 | #include <asm/head.h> |
26 | #include <asm/ptrace.h> | 26 | #include <asm/ptrace.h> |
@@ -1431,7 +1431,7 @@ EXPORT_SYMBOL(__per_cpu_shift); | |||
1431 | 1431 | ||
1432 | void __init real_setup_per_cpu_areas(void) | 1432 | void __init real_setup_per_cpu_areas(void) |
1433 | { | 1433 | { |
1434 | unsigned long goal, size, i; | 1434 | unsigned long paddr, goal, size, i; |
1435 | char *ptr; | 1435 | char *ptr; |
1436 | 1436 | ||
1437 | /* Copy section for each CPU (we discard the original) */ | 1437 | /* Copy section for each CPU (we discard the original) */ |
@@ -1441,8 +1441,13 @@ void __init real_setup_per_cpu_areas(void) | |||
1441 | for (size = PAGE_SIZE; size < goal; size <<= 1UL) | 1441 | for (size = PAGE_SIZE; size < goal; size <<= 1UL) |
1442 | __per_cpu_shift++; | 1442 | __per_cpu_shift++; |
1443 | 1443 | ||
1444 | ptr = alloc_bootmem_pages(size * NR_CPUS); | 1444 | paddr = lmb_alloc(size * NR_CPUS, PAGE_SIZE); |
1445 | if (!paddr) { | ||
1446 | prom_printf("Cannot allocate per-cpu memory.\n"); | ||
1447 | prom_halt(); | ||
1448 | } | ||
1445 | 1449 | ||
1450 | ptr = __va(paddr); | ||
1446 | __per_cpu_base = ptr - __per_cpu_start; | 1451 | __per_cpu_base = ptr - __per_cpu_start; |
1447 | 1452 | ||
1448 | for (i = 0; i < NR_CPUS; i++, ptr += size) | 1453 | for (i = 0; i < NR_CPUS; i++, ptr += size) |
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index 90e644a0e933..658ec462ed45 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -1208,6 +1208,12 @@ void __init paging_init(void) | |||
1208 | if (tlb_type == hypervisor) | 1208 | if (tlb_type == hypervisor) |
1209 | sun4v_ktsb_register(); | 1209 | sun4v_ktsb_register(); |
1210 | 1210 | ||
1211 | /* We must setup the per-cpu areas before we pull in the | ||
1212 | * PROM and the MDESC. The code there fills in cpu and | ||
1213 | * other information into per-cpu data structures. | ||
1214 | */ | ||
1215 | real_setup_per_cpu_areas(); | ||
1216 | |||
1211 | /* Setup bootmem... */ | 1217 | /* Setup bootmem... */ |
1212 | pages_avail = 0; | 1218 | pages_avail = 0; |
1213 | last_valid_pfn = end_pfn = bootmem_init(&pages_avail, phys_base); | 1219 | last_valid_pfn = end_pfn = bootmem_init(&pages_avail, phys_base); |
@@ -1216,8 +1222,6 @@ void __init paging_init(void) | |||
1216 | 1222 | ||
1217 | kernel_physical_mapping_init(); | 1223 | kernel_physical_mapping_init(); |
1218 | 1224 | ||
1219 | real_setup_per_cpu_areas(); | ||
1220 | |||
1221 | prom_build_devicetree(); | 1225 | prom_build_devicetree(); |
1222 | 1226 | ||
1223 | if (tlb_type == hypervisor) | 1227 | if (tlb_type == hypervisor) |