summaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/smpboot.c
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2010-06-25 23:04:17 +0200
committerChris Metcalf <cmetcalf@tilera.com>2010-07-06 19:41:51 +0200
commit0707ad30d10110aebc01a5a64fb63f4b32d20b73 (patch)
tree64d8ba73e605ac26e56808d1d77701b3f83cf8b2 /arch/tile/kernel/smpboot.c
parentarch/tile: Split the icache flush code off to a generic <arch> header. (diff)
downloadlinux-0707ad30d10110aebc01a5a64fb63f4b32d20b73.tar.xz
linux-0707ad30d10110aebc01a5a64fb63f4b32d20b73.zip
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 aa3aafdb4b93..74d62d098edf 100644
--- a/arch/tile/kernel/smpboot.c
+++ b/arch/tile/kernel/smpboot.c
@@ -25,19 +25,13 @@
#include <linux/percpu.h>
#include <linux/delay.h>
#include <linux/err.h>
+#include <linux/irq.h>
#include <asm/mmu_context.h>
#include <asm/tlbflush.h>
#include <asm/sections.h>
-/*
- * This assembly function is provided in entry.S.
- * When called, it loops on a nap instruction forever.
- * FIXME: should be in a header somewhere.
- */
-extern void smp_nap(void);
-
/* State of each CPU. */
-DEFINE_PER_CPU(int, cpu_state) = { 0 };
+static DEFINE_PER_CPU(int, cpu_state) = { 0 };
/* The messaging code jumps to this pointer during boot-up */
unsigned long start_cpu_function_addr;
@@ -74,7 +68,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
*/
rc = sched_setaffinity(current->pid, cpumask_of(boot_cpu));
if (rc != 0)
- printk("Couldn't set init affinity to boot cpu (%ld)\n", rc);
+ pr_err("Couldn't set init affinity to boot cpu (%ld)\n", rc);
/* Print information about disabled and dataplane cpus. */
print_disabled_cpus();
@@ -134,13 +128,13 @@ static __init int reset_init_affinity(void)
{
long rc = sched_setaffinity(current->pid, &init_affinity);
if (rc != 0)
- printk(KERN_WARNING "couldn't reset init affinity (%ld)\n",
+ pr_warning("couldn't reset init affinity (%ld)\n",
rc);
return 0;
}
late_initcall(reset_init_affinity);
-struct cpumask cpu_started __cpuinitdata;
+static struct cpumask cpu_started __cpuinitdata;
/*
* Activate a secondary processor. Very minimal; don't add anything
@@ -172,9 +166,6 @@ static void __cpuinit start_secondary(void)
BUG();
enter_lazy_tlb(&init_mm, current);
- /* Enable IRQs. */
- init_per_tile_IRQs();
-
/* Allow hypervisor messages to be received */
init_messaging();
local_irq_enable();
@@ -182,7 +173,7 @@ static void __cpuinit start_secondary(void)
/* Indicate that we're ready to come up. */
/* Must not do this before we're ready to receive messages */
if (cpumask_test_and_set_cpu(cpuid, &cpu_started)) {
- printk(KERN_WARNING "CPU#%d already started!\n", cpuid);
+ pr_warning("CPU#%d already started!\n", cpuid);
for (;;)
local_irq_enable();
}
@@ -190,13 +181,10 @@ static void __cpuinit start_secondary(void)
smp_nap();
}
-void setup_mpls(void); /* from kernel/setup.c */
-void store_permanent_mappings(void);
-
/*
* Bring a secondary processor online.
*/
-void __cpuinit online_secondary()
+void __cpuinit online_secondary(void)
{
/*
* low-memory mappings have been cleared, flush them from
@@ -222,17 +210,14 @@ void __cpuinit online_secondary()
ipi_call_unlock();
__get_cpu_var(cpu_state) = CPU_ONLINE;
- /* Set up MPLs for this processor */
- setup_mpls();
-
+ /* Set up tile-specific state for this cpu. */
+ setup_cpu(0);
/* Set up tile-timer clock-event device on this cpu */
setup_tile_timer();
preempt_enable();
- store_permanent_mappings();
-
cpu_idle();
}
@@ -242,7 +227,7 @@ int __cpuinit __cpu_up(unsigned int cpu)
static int timeout;
for (; !cpumask_test_cpu(cpu, &cpu_started); timeout++) {
if (timeout >= 50000) {
- printk(KERN_INFO "skipping unresponsive cpu%d\n", cpu);
+ pr_info("skipping unresponsive cpu%d\n", cpu);
local_irq_enable();
return -EIO;
}
@@ -289,5 +274,5 @@ void __init smp_cpus_done(unsigned int max_cpus)
;
rc = sched_setaffinity(current->pid, cpumask_of(cpu));
if (rc != 0)
- printk("Couldn't set init affinity to cpu %d (%d)\n", cpu, rc);
+ pr_err("Couldn't set init affinity to cpu %d (%d)\n", cpu, rc);
}