summaryrefslogtreecommitdiffstats
path: root/kernel/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r--kernel/cpu.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index b5eacb9587af..65e34d34ca93 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -666,6 +666,19 @@ void notify_cpu_starting(unsigned int cpu)
}
}
+/*
+ * Called from the idle task. We need to set active here, so we can kick off
+ * the stopper thread.
+ */
+static int cpuhp_set_cpu_active(unsigned int cpu)
+{
+ /* The cpu is marked online, set it active now */
+ set_cpu_active(cpu, true);
+ /* Unpark the stopper thread */
+ stop_machine_unpark(cpu);
+ return 0;
+}
+
static void undo_cpu_up(unsigned int cpu, struct cpuhp_cpu_state *st)
{
for (st->state--; st->state > st->target; st->state--) {
@@ -941,6 +954,11 @@ static struct cpuhp_step cpuhp_bp_states[] = {
.teardown = takedown_cpu,
.cant_stop = true,
},
+ [CPUHP_CPU_SET_ACTIVE] = {
+ .name = "cpu:active",
+ .startup = cpuhp_set_cpu_active,
+ .teardown = NULL,
+ },
[CPUHP_NOTIFY_ONLINE] = {
.name = "notify:online",
.startup = notify_online,