aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/smp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kernel/smp.c')
-rw-r--r--arch/s390/kernel/smp.c35
1 files changed, 3 insertions, 32 deletions
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index e505458c6899..647ba9425893 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -85,7 +85,6 @@ enum {
85 85
86struct pcpu { 86struct pcpu {
87 struct cpu cpu; 87 struct cpu cpu;
88 struct task_struct *idle; /* idle process for the cpu */
89 struct _lowcore *lowcore; /* lowcore page(s) for the cpu */ 88 struct _lowcore *lowcore; /* lowcore page(s) for the cpu */
90 unsigned long async_stack; /* async stack for the cpu */ 89 unsigned long async_stack; /* async stack for the cpu */
91 unsigned long panic_stack; /* panic stack for the cpu */ 90 unsigned long panic_stack; /* panic stack for the cpu */
@@ -725,26 +724,9 @@ static void __cpuinit smp_start_secondary(void *cpuvoid)
725 cpu_idle(); 724 cpu_idle();
726} 725}
727 726
728struct create_idle {
729 struct work_struct work;
730 struct task_struct *idle;
731 struct completion done;
732 int cpu;
733};
734
735static void __cpuinit smp_fork_idle(struct work_struct *work)
736{
737 struct create_idle *c_idle;
738
739 c_idle = container_of(work, struct create_idle, work);
740 c_idle->idle = fork_idle(c_idle->cpu);
741 complete(&c_idle->done);
742}
743
744/* Upping and downing of CPUs */ 727/* Upping and downing of CPUs */
745int __cpuinit __cpu_up(unsigned int cpu) 728int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle)
746{ 729{
747 struct create_idle c_idle;
748 struct pcpu *pcpu; 730 struct pcpu *pcpu;
749 int rc; 731 int rc;
750 732
@@ -754,22 +736,12 @@ int __cpuinit __cpu_up(unsigned int cpu)
754 if (pcpu_sigp_retry(pcpu, sigp_initial_cpu_reset, 0) != 736 if (pcpu_sigp_retry(pcpu, sigp_initial_cpu_reset, 0) !=
755 sigp_order_code_accepted) 737 sigp_order_code_accepted)
756 return -EIO; 738 return -EIO;
757 if (!pcpu->idle) { 739
758 c_idle.done = COMPLETION_INITIALIZER_ONSTACK(c_idle.done);
759 INIT_WORK_ONSTACK(&c_idle.work, smp_fork_idle);
760 c_idle.cpu = cpu;
761 schedule_work(&c_idle.work);
762 wait_for_completion(&c_idle.done);
763 if (IS_ERR(c_idle.idle))
764 return PTR_ERR(c_idle.idle);
765 pcpu->idle = c_idle.idle;
766 }
767 init_idle(pcpu->idle, cpu);
768 rc = pcpu_alloc_lowcore(pcpu, cpu); 740 rc = pcpu_alloc_lowcore(pcpu, cpu);
769 if (rc) 741 if (rc)
770 return rc; 742 return rc;
771 pcpu_prepare_secondary(pcpu, cpu); 743 pcpu_prepare_secondary(pcpu, cpu);
772 pcpu_attach_task(pcpu, pcpu->idle); 744 pcpu_attach_task(pcpu, tidle);
773 pcpu_start_fn(pcpu, smp_start_secondary, NULL); 745 pcpu_start_fn(pcpu, smp_start_secondary, NULL);
774 while (!cpu_online(cpu)) 746 while (!cpu_online(cpu))
775 cpu_relax(); 747 cpu_relax();
@@ -856,7 +828,6 @@ void __init smp_prepare_boot_cpu(void)
856 struct pcpu *pcpu = pcpu_devices; 828 struct pcpu *pcpu = pcpu_devices;
857 829
858 boot_cpu_address = stap(); 830 boot_cpu_address = stap();
859 pcpu->idle = current;
860 pcpu->state = CPU_STATE_CONFIGURED; 831 pcpu->state = CPU_STATE_CONFIGURED;
861 pcpu->address = boot_cpu_address; 832 pcpu->address = boot_cpu_address;
862 pcpu->lowcore = (struct _lowcore *)(unsigned long) store_prefix(); 833 pcpu->lowcore = (struct _lowcore *)(unsigned long) store_prefix();