aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/smpboot.c
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2010-06-25 17:04:17 -0400
committerChris Metcalf <cmetcalf@tilera.com>2010-07-06 13:41:51 -0400
commit0707ad30d10110aebc01a5a64fb63f4b32d20b73 (patch)
tree64d8ba73e605ac26e56808d1d77701b3f83cf8b2 /arch/tile/kernel/smpboot.c
parentc78095bd8c77fca2619769ff8efb639fd100e373 (diff)
arch/tile: Miscellaneous cleanup changes.
This commit is primarily changes caused by reviewing "sparse" and "checkpatch" output on our sources, so is somewhat noisy, since things like "printk() -> pr_err()" (or whatever) throughout the codebase tend to get tedious to read. Rather than trying to tease apart precisely which things changed due to which type of code review, this commit includes various cleanups in the code: - sparse: Add declarations in headers for globals. - sparse: Fix __user annotations. - sparse: Using gfp_t consistently instead of int. - sparse: removing functions not actually used. - checkpatch: Clean up printk() warnings by using pr_info(), etc.; also avoid partial-line printks except in bootup code. - checkpatch: Use exposed structs rather than typedefs. - checkpatch: Change some C99 comments to C89 comments. In addition, a couple of minor other changes are rolled in to this commit: - Add support for a "raise" instruction to cause SIGFPE, etc., to be raised. - Remove some compat code that is unnecessary when we fully eliminate some of the deprecated syscalls from the generic syscall ABI. - Update the tile_defconfig to reflect current config contents. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/tile/kernel/smpboot.c')
-rw-r--r--arch/tile/kernel/smpboot.c37
1 files changed, 11 insertions, 26 deletions
diff --git a/arch/tile/kernel/smpboot.c b/arch/tile/kernel/smpboot.c
index aa3aafdb4b9..74d62d098ed 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 */
37extern void smp_nap(void);
38
39/* State of each CPU. */ 33/* State of each CPU. */
40DEFINE_PER_CPU(int, cpu_state) = { 0 }; 34static 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 */
43unsigned long start_cpu_function_addr; 37unsigned 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}
141late_initcall(reset_init_affinity); 135late_initcall(reset_init_affinity);
142 136
143struct cpumask cpu_started __cpuinitdata; 137static 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
193void setup_mpls(void); /* from kernel/setup.c */
194void store_permanent_mappings(void);
195
196/* 184/*
197 * Bring a secondary processor online. 185 * Bring a secondary processor online.
198 */ 186 */
199void __cpuinit online_secondary() 187void __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}