masayuki2009 opened a new pull request #2204: URL: https://github.com/apache/incubator-nuttx/pull/2204
## Summary - I found a deadlock during Wi-Fi audio streaming test plus stress test - The testing environment was spresense:wifi_smp (NCPUS=4) - The deadlock happened because two CPUs called up_cpu_pause() almost simultaneously - This situation should not happen, because up_cpu_pause() is called in a critical section - Actually, the latter call was from nxsem_post() in an IRQ handler - And when enter_critical_section() was called, irq_waitlock() detected a deadlock - Then it called up_cpu_paused() to break the deadlock - However, this resulted in setting g_cpu_irqset on the CPU - Even though another CPU had held a g_cpu_irqlock - This situation violates the critical section and should be avoided - To avoid the situation, if a CPU sets g_cpu_irqset after calling up_cpu_paused() - The CPU must release g_cpu_irqlock first - Then retry irq_waitlock() to acquire g_cpu_irqlock ## Impact - Affect SMP ## Testing - Tested with spresense:wifi_smp (NCPUS=2 and 4) - Tested with spresense:smp - Tested with sim:smp - Tested with sabre-6quad:smp (QEMU) - Tested with maix-bit:smp (QEMU) - Tested with esp32-core:smp (QEMU) - Tested with lc823450-xgevk:rndis ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org