This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit a50d673df77e30b447d85259be5b912626fe79ce Author: Abdelatif Guettouche <[email protected]> AuthorDate: Thu Sep 9 23:50:27 2021 +0200 esp32_wifi_adapter.c: Don't hold another spinlock when calling enter_critical_section, we already hold the global IRQ spinlock. Signed-off-by: Abdelatif Guettouche <[email protected]> --- arch/xtensa/src/esp32/esp32_wifi_adapter.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/arch/xtensa/src/esp32/esp32_wifi_adapter.c b/arch/xtensa/src/esp32/esp32_wifi_adapter.c index 1feffee..f8797e5 100644 --- a/arch/xtensa/src/esp32/esp32_wifi_adapter.c +++ b/arch/xtensa/src/esp32/esp32_wifi_adapter.c @@ -977,9 +977,9 @@ static uint32_t IRAM_ATTR esp_wifi_int_disable(void *wifi_int_mux) flags = enter_critical_section(); -#ifdef CONFIG_SMP - spin_lock((volatile spinlock_t *)wifi_int_mux); -#endif + /* In SMP mode enter_critical_section already hold the global IRQ spinlock. + * We don't need another spinlock, so wifi_int_mux is unused here. + */ return (uint32_t)flags; } @@ -1004,10 +1004,6 @@ static void IRAM_ATTR esp_wifi_int_restore(void *wifi_int_mux, uint32_t tmp) { irqstate_t flags = (irqstate_t)tmp; -#ifdef CONFIG_SMP - spin_unlock((volatile spinlock_t *)wifi_int_mux); -#endif - leave_critical_section(flags); }
