anchao commented on code in PR #13349:
URL: https://github.com/apache/nuttx/pull/13349#discussion_r1764362955


##########
sched/irq/irq_csection.c:
##########
@@ -345,6 +345,26 @@ irqstate_t enter_critical_section(void)
         }
       else
         {
+          /* CHECK IRQ
+           *
+           * After the OS starts, in the thread context,
+           * we must ensure that the interrupt is not masked
+           * when first enters the critical section.
+           * Otherwise, at this time when another CPU issues a pause
+           * interrupt to the current CPU, it can lead to a deadlock.
+           *
+           * During the vela os startup phase, interrupts are masked until

Review Comment:
   ```suggestion
              * During the OS startup phase, interrupts are masked until
   ```
   Do not include any specific platform comments in NuttX Community FYI 
@acassis 



##########
sched/irq/irq_csection.c:
##########
@@ -345,6 +345,26 @@ irqstate_t enter_critical_section(void)
         }
       else
         {
+          /* CHECK IRQ
+           *
+           * After the OS starts, in the thread context,
+           * we must ensure that the interrupt is not masked
+           * when first enters the critical section.
+           * Otherwise, at this time when another CPU issues a pause
+           * interrupt to the current CPU, it can lead to a deadlock.
+           *
+           * During the vela os startup phase, interrupts are masked until
+           * the interrupt initialization function (irq_initialize) is

Review Comment:
   Shouldn't we make sure that the common code flow before `irq_initialize()` 
calls spinlock instead of enter_critical_section, so that this check could be 
removed?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to