From dfe16378645d6ec4680aecd9a7124d03ced65bae Mon Sep 17 00:00:00 2001 From: Abdelatif Guettouche Date: Wed, 29 Sep 2021 14:08:17 +0200 Subject: [PATCH] esp32_spiflash.c: Pause the other CPU during flash operation. Signed-off-by: Abdelatif Guettouche --- arch/xtensa/src/esp32/esp32_spiflash.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/xtensa/src/esp32/esp32_spiflash.c b/arch/xtensa/src/esp32/esp32_spiflash.c index 295bfecffa..3f90bc879f 100644 --- a/arch/xtensa/src/esp32/esp32_spiflash.c +++ b/arch/xtensa/src/esp32/esp32_spiflash.c @@ -419,6 +419,7 @@ static inline void IRAM_ATTR DEBUGASSERT(state->cpu == 0 || state->cpu == 1); #ifdef CONFIG_SMP DEBUGASSERT(other == 0 || other == 1); + up_cpu_pause(other); #endif spi_disable_cache(state->cpu, &state->val[state->cpu]); @@ -454,6 +455,7 @@ static inline void IRAM_ATTR spi_enable_cache(state->cpu, state->val[state->cpu]); #ifdef CONFIG_SMP spi_enable_cache(other, state->val[other]); + up_cpu_resume(other); #endif leave_critical_section(state->flags);