diff options
Diffstat (limited to 'arch/sparc/kernel/smp_64.c')
-rw-r--r-- | arch/sparc/kernel/smp_64.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c index a42a4a744d14..b03fd362c629 100644 --- a/arch/sparc/kernel/smp_64.c +++ b/arch/sparc/kernel/smp_64.c | |||
@@ -1478,9 +1478,10 @@ void __init setup_per_cpu_areas(void) | |||
1478 | static struct vm_struct vm; | 1478 | static struct vm_struct vm; |
1479 | struct pcpu_alloc_info *ai; | 1479 | struct pcpu_alloc_info *ai; |
1480 | unsigned long delta, cpu; | 1480 | unsigned long delta, cpu; |
1481 | size_t size_sum, pcpu_unit_size; | 1481 | size_t size_sum; |
1482 | size_t ptrs_size; | 1482 | size_t ptrs_size; |
1483 | void **ptrs; | 1483 | void **ptrs; |
1484 | int rc; | ||
1484 | 1485 | ||
1485 | ai = pcpu_alloc_alloc_info(1, nr_cpu_ids); | 1486 | ai = pcpu_alloc_alloc_info(1, nr_cpu_ids); |
1486 | 1487 | ||
@@ -1526,14 +1527,15 @@ void __init setup_per_cpu_areas(void) | |||
1526 | pcpu_map_range(start, end, virt_to_page(ptrs[cpu])); | 1527 | pcpu_map_range(start, end, virt_to_page(ptrs[cpu])); |
1527 | } | 1528 | } |
1528 | 1529 | ||
1529 | pcpu_unit_size = pcpu_setup_first_chunk(ai, vm.addr); | 1530 | rc = pcpu_setup_first_chunk(ai, vm.addr); |
1531 | if (rc) | ||
1532 | panic("failed to setup percpu first chunk (%d)", rc); | ||
1530 | 1533 | ||
1531 | free_bootmem(__pa(ptrs), ptrs_size); | 1534 | free_bootmem(__pa(ptrs), ptrs_size); |
1532 | 1535 | ||
1533 | delta = (unsigned long)pcpu_base_addr - (unsigned long)__per_cpu_start; | 1536 | delta = (unsigned long)pcpu_base_addr - (unsigned long)__per_cpu_start; |
1534 | for_each_possible_cpu(cpu) { | 1537 | for_each_possible_cpu(cpu) |
1535 | __per_cpu_offset(cpu) = delta + cpu * pcpu_unit_size; | 1538 | __per_cpu_offset(cpu) = delta + pcpu_unit_offsets[cpu]; |
1536 | } | ||
1537 | 1539 | ||
1538 | /* Setup %g5 for the boot cpu. */ | 1540 | /* Setup %g5 for the boot cpu. */ |
1539 | __local_per_cpu_offset = __per_cpu_offset(smp_processor_id()); | 1541 | __local_per_cpu_offset = __per_cpu_offset(smp_processor_id()); |