tmedicci commented on PR #10496: URL: https://github.com/apache/nuttx/pull/10496#issuecomment-1763419169
> > This operation causes a deadlock because of the critical section of [`esp32s3_phy_enable`](https://github.com/apache/nuttx/blob/1989749850eff1b57bf543983ddffbdc8307d071/arch/xtensa/src/esp32s3/esp32s3_wireless.c#L468). The CPU pause will hang [here](https://github.com/apache/nuttx/blob/1989749850eff1b57bf543983ddffbdc8307d071/arch/xtensa/src/common/xtensa_cpupause.c#L196): not because of the CPU pause operation (the other CPU was already resumed), but because this `enter_critical_section` will keep looping in [`irq_waitlock`](https://github.com/apache/nuttx/blob/1989749850eff1b57bf543983ddffbdc8307d071/sched/irq/irq_csection.c#L123) because it can't acquire the spinlock (owned by `esp32s3_phy_enable`). > > Do you handle up_cpu_pausereq in arch/chip specific code correctly? [`up_cpu_pausereq`](https://github.com/apache/nuttx/blob/35b597ec2c0154ca675d2cd73f969c717aa3d739/arch/xtensa/src/common/xtensa_cpupause.c#L67) is a common code of xtensa arch, which is the same as other archs. This is check in [`xtensa_pause_handler`](https://github.com/apache/nuttx/blob/35b597ec2c0154ca675d2cd73f969c717aa3d739/arch/xtensa/src/common/xtensa_cpupause.c#L187) which is also similar/equal to other archs ([`arm_pause_handler`](https://github.com/apache/nuttx/blob/35b597ec2c0154ca675d2cd73f969c717aa3d739/arch/arm/src/armv7-a/arm_cpupause.c#L197), for instance: both are called inside an ISR) I can't see any problems regarding handling. I'd say that the same situation will happen for any arch: the problem seems to be calling `up_cpu_pause` on a nested critical section. Do you have any thoughts about it, @xiaoxiang781216 ? -- 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