Commit fc6d73d6 authored by Thomas Gleixner's avatar Thomas Gleixner

arch/hotplug: Call into idle with a proper state

Let the non boot cpus call into idle with the corresponding hotplug state, so
the hotplug core can handle the further bringup. That's a first step to
convert the boot side of the hotplugged cpus to do all the synchronization
with the other side through the state machine. For now it'll only start the
hotplug thread and kick the full bringup of the cpu.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: linux-arch@vger.kernel.org
Cc: Rik van Riel <riel@redhat.com>
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com>
Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Sebastian Siewior <bigeasy@linutronix.de>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul Turner <pjt@google.com>
Link: http://lkml.kernel.org/r/20160226182341.614102639@linutronix.deSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 1cf4f629
...@@ -168,7 +168,7 @@ smp_callin(void) ...@@ -168,7 +168,7 @@ smp_callin(void)
cpuid, current, current->active_mm)); cpuid, current, current->active_mm));
preempt_disable(); preempt_disable();
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
} }
/* Wait until hwrpb->txrdy is clear for cpu. Return -1 on timeout. */ /* Wait until hwrpb->txrdy is clear for cpu. Return -1 on timeout. */
......
...@@ -142,7 +142,7 @@ void start_kernel_secondary(void) ...@@ -142,7 +142,7 @@ void start_kernel_secondary(void)
local_irq_enable(); local_irq_enable();
preempt_disable(); preempt_disable();
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
} }
/* /*
......
...@@ -409,7 +409,7 @@ asmlinkage void secondary_start_kernel(void) ...@@ -409,7 +409,7 @@ asmlinkage void secondary_start_kernel(void)
/* /*
* OK, it's off to the idle thread for us * OK, it's off to the idle thread for us
*/ */
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
} }
void __init smp_cpus_done(unsigned int max_cpus) void __init smp_cpus_done(unsigned int max_cpus)
......
...@@ -195,7 +195,7 @@ asmlinkage void secondary_start_kernel(void) ...@@ -195,7 +195,7 @@ asmlinkage void secondary_start_kernel(void)
/* /*
* OK, it's off to the idle thread for us * OK, it's off to the idle thread for us
*/ */
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
} }
#ifdef CONFIG_HOTPLUG_CPU #ifdef CONFIG_HOTPLUG_CPU
......
...@@ -333,7 +333,7 @@ void secondary_start_kernel(void) ...@@ -333,7 +333,7 @@ void secondary_start_kernel(void)
/* We are done with local CPU inits, unblock the boot CPU. */ /* We are done with local CPU inits, unblock the boot CPU. */
set_cpu_online(cpu, true); set_cpu_online(cpu, true);
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
} }
void __init smp_prepare_boot_cpu(void) void __init smp_prepare_boot_cpu(void)
......
...@@ -180,7 +180,7 @@ void start_secondary(void) ...@@ -180,7 +180,7 @@ void start_secondary(void)
local_irq_enable(); local_irq_enable();
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
} }
......
...@@ -454,7 +454,7 @@ start_secondary (void *unused) ...@@ -454,7 +454,7 @@ start_secondary (void *unused)
preempt_disable(); preempt_disable();
smp_callin(); smp_callin();
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
return 0; return 0;
} }
......
...@@ -432,7 +432,7 @@ int __init start_secondary(void *unused) ...@@ -432,7 +432,7 @@ int __init start_secondary(void *unused)
*/ */
local_flush_tlb_all(); local_flush_tlb_all();
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
return 0; return 0;
} }
......
...@@ -396,7 +396,7 @@ asmlinkage void secondary_start_kernel(void) ...@@ -396,7 +396,7 @@ asmlinkage void secondary_start_kernel(void)
/* /*
* OK, it's off to the idle thread for us * OK, it's off to the idle thread for us
*/ */
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
} }
void __init smp_cpus_done(unsigned int max_cpus) void __init smp_cpus_done(unsigned int max_cpus)
......
...@@ -191,7 +191,7 @@ asmlinkage void start_secondary(void) ...@@ -191,7 +191,7 @@ asmlinkage void start_secondary(void)
WARN_ON_ONCE(!irqs_disabled()); WARN_ON_ONCE(!irqs_disabled());
mp_ops->smp_finish(); mp_ops->smp_finish();
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
} }
static void stop_this_cpu(void *dummy) static void stop_this_cpu(void *dummy)
......
...@@ -675,7 +675,7 @@ int __init start_secondary(void *unused) ...@@ -675,7 +675,7 @@ int __init start_secondary(void *unused)
#ifdef CONFIG_GENERIC_CLOCKEVENTS #ifdef CONFIG_GENERIC_CLOCKEVENTS
init_clockevents(); init_clockevents();
#endif #endif
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
return 0; return 0;
} }
......
...@@ -305,7 +305,7 @@ void __init smp_callin(void) ...@@ -305,7 +305,7 @@ void __init smp_callin(void)
local_irq_enable(); /* Interrupts have been off until now */ local_irq_enable(); /* Interrupts have been off until now */
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
/* NOTREACHED */ /* NOTREACHED */
panic("smp_callin() AAAAaaaaahhhh....\n"); panic("smp_callin() AAAAaaaaahhhh....\n");
......
...@@ -727,7 +727,7 @@ void start_secondary(void *unused) ...@@ -727,7 +727,7 @@ void start_secondary(void *unused)
local_irq_enable(); local_irq_enable();
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
BUG(); BUG();
} }
......
...@@ -798,7 +798,7 @@ static void smp_start_secondary(void *cpuvoid) ...@@ -798,7 +798,7 @@ static void smp_start_secondary(void *cpuvoid)
set_cpu_online(smp_processor_id(), true); set_cpu_online(smp_processor_id(), true);
inc_irq_stat(CPU_RST); inc_irq_stat(CPU_RST);
local_irq_enable(); local_irq_enable();
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
} }
/* Upping and downing of CPUs */ /* Upping and downing of CPUs */
......
...@@ -203,7 +203,7 @@ asmlinkage void start_secondary(void) ...@@ -203,7 +203,7 @@ asmlinkage void start_secondary(void)
set_cpu_online(cpu, true); set_cpu_online(cpu, true);
per_cpu(cpu_state, cpu) = CPU_ONLINE; per_cpu(cpu_state, cpu) = CPU_ONLINE;
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
} }
extern struct { extern struct {
......
...@@ -364,7 +364,7 @@ static void sparc_start_secondary(void *arg) ...@@ -364,7 +364,7 @@ static void sparc_start_secondary(void *arg)
local_irq_enable(); local_irq_enable();
wmb(); wmb();
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
/* We should never reach here! */ /* We should never reach here! */
BUG(); BUG();
......
...@@ -134,7 +134,7 @@ void smp_callin(void) ...@@ -134,7 +134,7 @@ void smp_callin(void)
local_irq_enable(); local_irq_enable();
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
} }
void cpu_panic(void) void cpu_panic(void)
......
...@@ -208,7 +208,7 @@ void online_secondary(void) ...@@ -208,7 +208,7 @@ void online_secondary(void)
/* Set up tile-timer clock-event device on this cpu */ /* Set up tile-timer clock-event device on this cpu */
setup_tile_timer(); setup_tile_timer();
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
} }
int __cpu_up(unsigned int cpu, struct task_struct *tidle) int __cpu_up(unsigned int cpu, struct task_struct *tidle)
......
...@@ -248,7 +248,7 @@ static void notrace start_secondary(void *unused) ...@@ -248,7 +248,7 @@ static void notrace start_secondary(void *unused)
x86_cpuinit.setup_percpu_clockev(); x86_cpuinit.setup_percpu_clockev();
wmb(); wmb();
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
} }
void __init smp_store_boot_cpu_info(void) void __init smp_store_boot_cpu_info(void)
......
...@@ -112,7 +112,7 @@ asmlinkage __visible void cpu_bringup_and_idle(int cpu) ...@@ -112,7 +112,7 @@ asmlinkage __visible void cpu_bringup_and_idle(int cpu)
xen_pvh_secondary_vcpu_init(cpu); xen_pvh_secondary_vcpu_init(cpu);
#endif #endif
cpu_bringup(); cpu_bringup();
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
} }
static void xen_smp_intr_free(unsigned int cpu) static void xen_smp_intr_free(unsigned int cpu)
......
...@@ -157,7 +157,7 @@ void secondary_start_kernel(void) ...@@ -157,7 +157,7 @@ void secondary_start_kernel(void)
complete(&cpu_running); complete(&cpu_running);
cpu_startup_entry(CPUHP_ONLINE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
} }
static void mx_cpu_start(void *p) static void mx_cpu_start(void *p)
......
...@@ -13,6 +13,7 @@ enum cpuhp_state { ...@@ -13,6 +13,7 @@ enum cpuhp_state {
CPUHP_CPU_SET_ACTIVE, CPUHP_CPU_SET_ACTIVE,
CPUHP_KICK_AP_THREAD, CPUHP_KICK_AP_THREAD,
CPUHP_BP_ONLINE, CPUHP_BP_ONLINE,
CPUHP_AP_ONLINE_IDLE,
CPUHP_AP_SMPBOOT_THREADS, CPUHP_AP_SMPBOOT_THREADS,
CPUHP_AP_NOTIFY_ONLINE, CPUHP_AP_NOTIFY_ONLINE,
CPUHP_AP_ONLINE_DYN, CPUHP_AP_ONLINE_DYN,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment