From fb12e7530dd38c4a709007d9273c263bb2afa8be Mon Sep 17 00:00:00 2001 From: zhangyuan21 Date: Thu, 27 Apr 2023 20:56:20 +0800 Subject: [PATCH] sched/smp: flush dcache before start other cpus core0 may write the data used by other cpu, this will cause cache inconsistency. so need fulsh dcache before start other cpus. Signed-off-by: zhangyuan21 --- sched/init/nx_smpstart.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sched/init/nx_smpstart.c b/sched/init/nx_smpstart.c index f0965f6ee9f..a740030ee35 100644 --- a/sched/init/nx_smpstart.c +++ b/sched/init/nx_smpstart.c @@ -111,6 +111,10 @@ int nx_smp_start(void) int ret; int cpu; + /* Flush dcache before start other CPUs. */ + + up_flush_dcache_all(); + /* Start all of the other CPUs. CPU0 is already running. */ for (cpu = 1; cpu < CONFIG_SMP_NCPUS; cpu++)