patacongo commented on code in PR #9404: URL: https://github.com/apache/nuttx/pull/9404#discussion_r1209338202
########## arch/xtensa/src/common/xtensa_nputs.c: ########## @@ -39,8 +40,14 @@ void up_nputs(const char *str, size_t len) Review Comment: > syslog can be called in interrupt context, we need some special handle like serial driver: > https://github.com/apache/nuttx/blob/master/drivers/serial/serial.c#L1189-L1209 The family of low-level serial output functions is typically used (1) very early in initialization before the serial driver has been initialized and (2) in interrupt handlers. Semaphores/mutexes should never be used before nxsem_initialize() is called. Otherwise you would be using the semaphore subsystem before it has been initialized. This may or may not work out for this case, but in general that is the architectural principle upon which the OS initialization was designed and should not be violated. So either (1) up_nputs() must not use semaphores or (2) up_nputs() must not be used prior to calling nxsem_initialize(). There is a global variable g_nx_init_state that can also be used to check where nx_start is in the initialization sequence. -- 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]
