masayuki2009 opened a new pull request #1951:
URL: https://github.com/apache/incubator-nuttx/pull/1951


   ## Summary
   
   - During Wi-Fi audio streaming test, I found a deadlock in nxtask_exit()
   - Actually, nxtask_exit() was called and tried to enter critical section
   - In enter_critical_section(), there is a deadlock avoidance logic
   - However, if switched to a new rtcb with irqcount=0, the logic did not work
   - Because the 2nd critical section was treated as if it were the 1st one
   - Actually, it tried to run the deadlock avoidance logic
   - But nxtask_exit() was called with critical section (i.e. IRQ already 
disabled)
   - So the logic did not work as expected because up_irq_restore() did not 
enable the IRQ.
   - This commit fixes this issue by incrementing irqcount before calling 
nxtask_terminate()
   - Also it adjusts g_cpu_irqlock and g_cpu_lockset
   
   ## Impact
   
   - Affects SMP only
   
   ## Testing
   
   - Tested with spresense:wifi_smp (smp, ostest, nxplayer, telnetd)
   - Tested with sabre-6quad:smp with QEMU (smp, ostest)
   - Tested with maix-bit:smp with QEMU (smp, ostest)
   - Tested with esp32-core:smp with QEMU (smp, ostest)
   
   


----------------------------------------------------------------
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:
[email protected]


Reply via email to