This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch releases/10.2
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 6e95087b3b314c3bfa576a1f7c0d78958cb39ce2
Author: Abdelatif Guettouche <abdelatif.guettou...@espressif.com>
AuthorDate: Wed Sep 29 14:08:17 2021 +0200

    esp32_spiflash.c: Pause the other CPU during flash operation.
    
    Signed-off-by: Abdelatif Guettouche <abdelatif.guettou...@espressif.com>
---
 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 295bfec..3f90bc8 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);

Reply via email to