hujun260 commented on code in PR #16673: URL: https://github.com/apache/nuttx/pull/16673#discussion_r2247076134
########## arch/xtensa/src/common/xtensa_sigdeliver.c: ########## @@ -154,12 +154,11 @@ void xtensa_sig_deliver(void) */ board_autoled_off(LED_SIGNAL); + #ifdef CONFIG_SMP /* We need to keep the IRQ lock until task switching */ - rtcb->irqcount++; - leave_critical_section((regs[REG_PS])); - rtcb->irqcount--; + leave_critical_section(up_irq_save()); Review Comment: <img width="806" height="458" alt="image" src="https://github.com/user-attachments/assets/9adbe83b-6614-4aae-bd17-7e4907b7139d" /> But interrupts are already masked here. And with this writing style, the value of regs[REG_PS] will not actually be used in leave_critical_section. ``` rtcb->irqcount++; leave_critical_section((regs[REG_PS])); rtcb->irqcount--; ``` -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org