[PATCH v1 06/20] ARC: Mark cpu online only after it has executed the per cpu init hook.

From: Noam Camus
Date: Sat Oct 31 2015 - 09:19:01 EST

From: Noam Camus <noamc@xxxxxxxxxx>

In SMP setup, master loops for each_present_cpu calling cpu_up() which
for ARC returns as soon as new cpu's status becomes online,
but it could still be initializing (see start_kernel_secondary())
Thus master can start cpu up for 2nd core,
while prev is still not fully up.
This can be issue for SMT system,
where first h/w thread of a core needs to be fully up before
moving on to next threads.

Signed-off-by: Noam Camus <noamc@xxxxxxxxxx>
Acked-by: Vineet Gupta <vgupta@xxxxxxxxxxxx>
arch/arc/kernel/smp.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c
index 5805878..946109f 100644
--- a/arch/arc/kernel/smp.c
+++ b/arch/arc/kernel/smp.c
@@ -126,6 +126,10 @@ void start_kernel_secondary(void)
current->active_mm = mm;
cpumask_set_cpu(cpu, mm_cpumask(mm));

+ /* Before we turn online */
+ if (machine_desc->init_cpu_smp)
+ machine_desc->init_cpu_smp(cpu);
set_cpu_online(cpu, true);

@@ -135,9 +139,6 @@ void start_kernel_secondary(void)
if (plat_smp_ops.init_irq_cpu)

- if (machine_desc->init_cpu_smp)
- machine_desc->init_cpu_smp(cpu);


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/