diff options
Diffstat (limited to 'arch/tile/kernel/smpboot.c')
-rw-r--r-- | arch/tile/kernel/smpboot.c | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/arch/tile/kernel/smpboot.c b/arch/tile/kernel/smpboot.c index aa3aafdb4b93..74d62d098edf 100644 --- a/arch/tile/kernel/smpboot.c +++ b/arch/tile/kernel/smpboot.c | |||
@@ -25,19 +25,13 @@ | |||
25 | #include <linux/percpu.h> | 25 | #include <linux/percpu.h> |
26 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
27 | #include <linux/err.h> | 27 | #include <linux/err.h> |
28 | #include <linux/irq.h> | ||
28 | #include <asm/mmu_context.h> | 29 | #include <asm/mmu_context.h> |
29 | #include <asm/tlbflush.h> | 30 | #include <asm/tlbflush.h> |
30 | #include <asm/sections.h> | 31 | #include <asm/sections.h> |
31 | 32 | ||
32 | /* | ||
33 | * This assembly function is provided in entry.S. | ||
34 | * When called, it loops on a nap instruction forever. | ||
35 | * FIXME: should be in a header somewhere. | ||
36 | */ | ||
37 | extern void smp_nap(void); | ||
38 | |||
39 | /* State of each CPU. */ | 33 | /* State of each CPU. */ |
40 | DEFINE_PER_CPU(int, cpu_state) = { 0 }; | 34 | static DEFINE_PER_CPU(int, cpu_state) = { 0 }; |
41 | 35 | ||
42 | /* The messaging code jumps to this pointer during boot-up */ | 36 | /* The messaging code jumps to this pointer during boot-up */ |
43 | unsigned long start_cpu_function_addr; | 37 | unsigned long start_cpu_function_addr; |
@@ -74,7 +68,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
74 | */ | 68 | */ |
75 | rc = sched_setaffinity(current->pid, cpumask_of(boot_cpu)); | 69 | rc = sched_setaffinity(current->pid, cpumask_of(boot_cpu)); |
76 | if (rc != 0) | 70 | if (rc != 0) |
77 | printk("Couldn't set init affinity to boot cpu (%ld)\n", rc); | 71 | pr_err("Couldn't set init affinity to boot cpu (%ld)\n", rc); |
78 | 72 | ||
79 | /* Print information about disabled and dataplane cpus. */ | 73 | /* Print information about disabled and dataplane cpus. */ |
80 | print_disabled_cpus(); | 74 | print_disabled_cpus(); |
@@ -134,13 +128,13 @@ static __init int reset_init_affinity(void) | |||
134 | { | 128 | { |
135 | long rc = sched_setaffinity(current->pid, &init_affinity); | 129 | long rc = sched_setaffinity(current->pid, &init_affinity); |
136 | if (rc != 0) | 130 | if (rc != 0) |
137 | printk(KERN_WARNING "couldn't reset init affinity (%ld)\n", | 131 | pr_warning("couldn't reset init affinity (%ld)\n", |
138 | rc); | 132 | rc); |
139 | return 0; | 133 | return 0; |
140 | } | 134 | } |
141 | late_initcall(reset_init_affinity); | 135 | late_initcall(reset_init_affinity); |
142 | 136 | ||
143 | struct cpumask cpu_started __cpuinitdata; | 137 | static struct cpumask cpu_started __cpuinitdata; |
144 | 138 | ||
145 | /* | 139 | /* |
146 | * Activate a secondary processor. Very minimal; don't add anything | 140 | * Activate a secondary processor. Very minimal; don't add anything |
@@ -172,9 +166,6 @@ static void __cpuinit start_secondary(void) | |||
172 | BUG(); | 166 | BUG(); |
173 | enter_lazy_tlb(&init_mm, current); | 167 | enter_lazy_tlb(&init_mm, current); |
174 | 168 | ||
175 | /* Enable IRQs. */ | ||
176 | init_per_tile_IRQs(); | ||
177 | |||
178 | /* Allow hypervisor messages to be received */ | 169 | /* Allow hypervisor messages to be received */ |
179 | init_messaging(); | 170 | init_messaging(); |
180 | local_irq_enable(); | 171 | local_irq_enable(); |
@@ -182,7 +173,7 @@ static void __cpuinit start_secondary(void) | |||
182 | /* Indicate that we're ready to come up. */ | 173 | /* Indicate that we're ready to come up. */ |
183 | /* Must not do this before we're ready to receive messages */ | 174 | /* Must not do this before we're ready to receive messages */ |
184 | if (cpumask_test_and_set_cpu(cpuid, &cpu_started)) { | 175 | if (cpumask_test_and_set_cpu(cpuid, &cpu_started)) { |
185 | printk(KERN_WARNING "CPU#%d already started!\n", cpuid); | 176 | pr_warning("CPU#%d already started!\n", cpuid); |
186 | for (;;) | 177 | for (;;) |
187 | local_irq_enable(); | 178 | local_irq_enable(); |
188 | } | 179 | } |
@@ -190,13 +181,10 @@ static void __cpuinit start_secondary(void) | |||
190 | smp_nap(); | 181 | smp_nap(); |
191 | } | 182 | } |
192 | 183 | ||
193 | void setup_mpls(void); /* from kernel/setup.c */ | ||
194 | void store_permanent_mappings(void); | ||
195 | |||
196 | /* | 184 | /* |
197 | * Bring a secondary processor online. | 185 | * Bring a secondary processor online. |
198 | */ | 186 | */ |
199 | void __cpuinit online_secondary() | 187 | void __cpuinit online_secondary(void) |
200 | { | 188 | { |
201 | /* | 189 | /* |
202 | * low-memory mappings have been cleared, flush them from | 190 | * low-memory mappings have been cleared, flush them from |
@@ -222,17 +210,14 @@ void __cpuinit online_secondary() | |||
222 | ipi_call_unlock(); | 210 | ipi_call_unlock(); |
223 | __get_cpu_var(cpu_state) = CPU_ONLINE; | 211 | __get_cpu_var(cpu_state) = CPU_ONLINE; |
224 | 212 | ||
225 | /* Set up MPLs for this processor */ | 213 | /* Set up tile-specific state for this cpu. */ |
226 | setup_mpls(); | 214 | setup_cpu(0); |
227 | |||
228 | 215 | ||
229 | /* Set up tile-timer clock-event device on this cpu */ | 216 | /* Set up tile-timer clock-event device on this cpu */ |
230 | setup_tile_timer(); | 217 | setup_tile_timer(); |
231 | 218 | ||
232 | preempt_enable(); | 219 | preempt_enable(); |
233 | 220 | ||
234 | store_permanent_mappings(); | ||
235 | |||
236 | cpu_idle(); | 221 | cpu_idle(); |
237 | } | 222 | } |
238 | 223 | ||
@@ -242,7 +227,7 @@ int __cpuinit __cpu_up(unsigned int cpu) | |||
242 | static int timeout; | 227 | static int timeout; |
243 | for (; !cpumask_test_cpu(cpu, &cpu_started); timeout++) { | 228 | for (; !cpumask_test_cpu(cpu, &cpu_started); timeout++) { |
244 | if (timeout >= 50000) { | 229 | if (timeout >= 50000) { |
245 | printk(KERN_INFO "skipping unresponsive cpu%d\n", cpu); | 230 | pr_info("skipping unresponsive cpu%d\n", cpu); |
246 | local_irq_enable(); | 231 | local_irq_enable(); |
247 | return -EIO; | 232 | return -EIO; |
248 | } | 233 | } |
@@ -289,5 +274,5 @@ void __init smp_cpus_done(unsigned int max_cpus) | |||
289 | ; | 274 | ; |
290 | rc = sched_setaffinity(current->pid, cpumask_of(cpu)); | 275 | rc = sched_setaffinity(current->pid, cpumask_of(cpu)); |
291 | if (rc != 0) | 276 | if (rc != 0) |
292 | printk("Couldn't set init affinity to cpu %d (%d)\n", cpu, rc); | 277 | pr_err("Couldn't set init affinity to cpu %d (%d)\n", cpu, rc); |
293 | } | 278 | } |