Skip to content

Commit 7cdb433

Browse files
akochetkovmmind
authored andcommitted
ARM: rockchip: fix kernel hang during smp initialization
In order to bring up secondary CPUs main CPU write trampoline code to SRAM. The trampoline code is written while secondary CPUs are powered on (at least that true for RK3188 CPU). Sometimes that leads to kernel hang. Probably because secondary CPU execute trampoline code while kernel doesn't expect. The patch moves SRAM initialization step to the point where all secondary CPUs are powered down. That fixes rarely hangs on RK3188: [ 0.091568] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000 [ 0.091996] rockchip_smp_prepare_cpus: ncores 4 Signed-off-by: Alexander Kochetkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Heiko Stuebner <[email protected]>
1 parent 19272b3 commit 7cdb433

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

arch/arm/mach-rockchip/platsmp.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,6 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus)
279279
}
280280

281281
if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) {
282-
if (rockchip_smp_prepare_sram(node)) {
283-
of_node_put(node);
284-
return;
285-
}
286-
287282
/* enable the SCU power domain */
288283
pmu_set_power_domain(PMU_PWRDN_SCU, true);
289284

@@ -316,11 +311,19 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus)
316311
asm ("mrc p15, 1, %0, c9, c0, 2\n" : "=r" (l2ctlr));
317312
ncores = ((l2ctlr >> 24) & 0x3) + 1;
318313
}
319-
of_node_put(node);
320314

321315
/* Make sure that all cores except the first are really off */
322316
for (i = 1; i < ncores; i++)
323317
pmu_set_power_domain(0 + i, false);
318+
319+
if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) {
320+
if (rockchip_smp_prepare_sram(node)) {
321+
of_node_put(node);
322+
return;
323+
}
324+
}
325+
326+
of_node_put(node);
324327
}
325328

326329
static void __init rk3036_smp_prepare_cpus(unsigned int max_cpus)

0 commit comments

Comments
 (0)