|
| 1 | +From 500d48948f43d18a07894b5fd4f891afbade1d79 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Antony Rheneus < [email protected]> |
| 3 | +Date: Thu, 1 Jul 2021 20:34:01 +0530 |
| 4 | +Subject: [PATCH 1/1] From 28c199cfda1746644211893b6614acbac970515b Mon Sep 17 |
| 5 | + 00:00:00 2001 Subject: [PATCH 1/1] CPU1 failed to come online |
| 6 | +MIME-Version: 1.0 |
| 7 | +Content-Type: text/plain; charset=UTF-8 |
| 8 | +Content-Transfer-Encoding: 8bit |
| 9 | + |
| 10 | +Issue: On contiuous reboot once in a while CPU1 (secondary cpu) doesn't |
| 11 | +come online |
| 12 | +The issue comes after migrating to Debian gcc 8.3.6, the issue was not seen till gcc7 |
| 13 | + |
| 14 | +Until introducing the Debian GCC 8.x version – the execution process didn’t influence |
| 15 | +mmu intialization before starting the socondary processor. |
| 16 | +The new GCC version makes some optimizations that execute the SW faster and once in a while, |
| 17 | +causing the Secondary CORE to start while the MMU is still in the initialization stage. |
| 18 | +Once adding a slight delay right after the MMU initialization – |
| 19 | +compensate the optimized code and enables the MMU to init successfully before the 2nd CORE starts. |
| 20 | + |
| 21 | +Signed-off-by: Antony Rheneus < [email protected]> |
| 22 | +--- |
| 23 | + arch/arm/mach-mvebu/platsmp-a9.c | 4 ++++ |
| 24 | + 1 file changed, 4 insertions(+) |
| 25 | + |
| 26 | +diff --git a/arch/arm/mach-mvebu/platsmp-a9.c b/arch/arm/mach-mvebu/platsmp-a9.c |
| 27 | +index d715dec..9c076c6 100644 |
| 28 | +--- a/arch/arm/mach-mvebu/platsmp-a9.c |
| 29 | ++++ b/arch/arm/mach-mvebu/platsmp-a9.c |
| 30 | +@@ -17,12 +17,15 @@ |
| 31 | + #include <linux/of.h> |
| 32 | + #include <linux/smp.h> |
| 33 | + #include <linux/mbus.h> |
| 34 | ++#include <linux/delay.h> |
| 35 | ++#include <linux/completion.h> |
| 36 | + #include <asm/smp_scu.h> |
| 37 | + #include <asm/smp_plat.h> |
| 38 | + #include "common.h" |
| 39 | + #include "pmsu.h" |
| 40 | + |
| 41 | + extern void mvebu_cortex_a9_secondary_startup(void); |
| 42 | ++static DECLARE_COMPLETION(cpu_wait); |
| 43 | + |
| 44 | + static int mvebu_cortex_a9_boot_secondary(unsigned int cpu, |
| 45 | + struct task_struct *idle) |
| 46 | +@@ -44,6 +47,7 @@ static int mvebu_cortex_a9_boot_secondary(unsigned int cpu, |
| 47 | + mvebu_pmsu_set_cpu_boot_addr(hw_cpu, mvebu_cortex_a9_secondary_startup); |
| 48 | + smp_wmb(); |
| 49 | + |
| 50 | ++ wait_for_completion_timeout(&cpu_wait, usecs_to_jiffies(10)); |
| 51 | + /* |
| 52 | + * Doing this before deasserting the CPUs is needed to wake up CPUs |
| 53 | + * in the offline state after using CPU hotplug. |
| 54 | +-- |
| 55 | +2.7.4 |
| 56 | + |
0 commit comments