CV-Bowen opened a new pull request, #22601: URL: https://github.com/apache/nuttx/pull/22601
## Summary `rptun_dev_stop()` tears the local side down the same way from every context, but it also runs from an interrupt or panic context (a reset or a panic notifier of a dying core), where waiting for the start thread to exit can block on locks the dying task holds. Only stop the remote through `rptun_stop()` there. The same reason applies to the device list lock: the panic notifiers reach `rptun_ioctl_foreach()` from a panicking task, where `g_rptun_lock` may be held by a task that is stopped for good. Skip the lock when the init state is at `OSINIT_PANIC` or later, as is already done in interrupt context. ## Impact Interrupt and panic context only; a stop from a healthy task context is unchanged. ## Testing Host: Ubuntu 22.04.5 LTS x86_64, QEMU version 10.2.1, sim: cc (Ubuntu 13.1.0-8ubuntu1~22.04) 13.1.0, qemu-armv8a: aarch64-none-elf-gcc (Arm GNU Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205 sim:rpserver with `CONFIG_BOARDCTL_RESET=y CONFIG_BOARD_RESET_ON_ASSERT=2 CONFIG_DEBUG_RPTUN=y CONFIG_DEBUG_RPTUN_ERROR=y CONFIG_RPTUN_TRACE_DUMP=y` builds with 0 warnings; the panic path that reaches `rptun_ioctl_foreach()` (core dump, then the reboot notifier) still runs, and `rpmsg dump all`, `rpmsg ping` keep working. No regression in rpmsg: sim:rpserver/rpproxy and qemu-armv8a:rpserver/rpproxy boot and pass the fixed rpmsg cases (dump, ping, rpmsgfs; 15/15). qemu-armv8a was built with LIBC_ENVPATH and BINFMT_CHECKEXEC disabled, which current master needs for nxinit to start nsh there; unrelated to this change. checkpatch passes. -- 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]
