aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/kernel/smp.c20
-rw-r--r--include/asm-arm/cpu.h1
2 files changed, 14 insertions, 7 deletions
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 826164945747..45877f5d5717 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -80,19 +80,23 @@ static DEFINE_SPINLOCK(smp_call_function_lock);
80 80
81int __cpuinit __cpu_up(unsigned int cpu) 81int __cpuinit __cpu_up(unsigned int cpu)
82{ 82{
83 struct task_struct *idle; 83 struct cpuinfo_arm *ci = &per_cpu(cpu_data, cpu);
84 struct task_struct *idle = ci->idle;
84 pgd_t *pgd; 85 pgd_t *pgd;
85 pmd_t *pmd; 86 pmd_t *pmd;
86 int ret; 87 int ret;
87 88
88 /* 89 /*
89 * Spawn a new process manually. Grab a pointer to 90 * Spawn a new process manually, if not already done.
90 * its task struct so we can mess with it 91 * Grab a pointer to its task struct so we can mess with it
91 */ 92 */
92 idle = fork_idle(cpu); 93 if (!idle) {
93 if (IS_ERR(idle)) { 94 idle = fork_idle(cpu);
94 printk(KERN_ERR "CPU%u: fork() failed\n", cpu); 95 if (IS_ERR(idle)) {
95 return PTR_ERR(idle); 96 printk(KERN_ERR "CPU%u: fork() failed\n", cpu);
97 return PTR_ERR(idle);
98 }
99 ci->idle = idle;
96 } 100 }
97 101
98 /* 102 /*
@@ -236,6 +240,8 @@ void __init smp_prepare_boot_cpu(void)
236{ 240{
237 unsigned int cpu = smp_processor_id(); 241 unsigned int cpu = smp_processor_id();
238 242
243 per_cpu(cpu_data, cpu).idle = current;
244
239 cpu_set(cpu, cpu_possible_map); 245 cpu_set(cpu, cpu_possible_map);
240 cpu_set(cpu, cpu_present_map); 246 cpu_set(cpu, cpu_present_map);
241 cpu_set(cpu, cpu_online_map); 247 cpu_set(cpu, cpu_online_map);
diff --git a/include/asm-arm/cpu.h b/include/asm-arm/cpu.h
index fcbdd40cb667..751bc7462074 100644
--- a/include/asm-arm/cpu.h
+++ b/include/asm-arm/cpu.h
@@ -16,6 +16,7 @@
16struct cpuinfo_arm { 16struct cpuinfo_arm {
17 struct cpu cpu; 17 struct cpu cpu;
18#ifdef CONFIG_SMP 18#ifdef CONFIG_SMP
19 struct task_struct *idle;
19 unsigned int loops_per_jiffy; 20 unsigned int loops_per_jiffy;
20#endif 21#endif
21}; 22};