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


##########
drivers/syslog/syslog_channel.c:
##########
@@ -234,23 +229,31 @@ g_syslog_channel[CONFIG_SYSLOG_MAX_CHANNELS] =
 #ifdef CONFIG_SYSLOG_DEFAULT
 static int syslog_default_putc(FAR syslog_channel_t *channel, int ch)
 {
-  UNUSED(channel);
-
 #  ifdef CONFIG_ARCH_LOWPUTC
+  /* See https://github.com/apache/nuttx/issues/14662
+   * about what this critical section is for.
+   */
+
+  irqstate_t flags = enter_critical_section();
   up_putc(ch);
+  leave_critical_section(flags);

Review Comment:
   I'm not sure if you've noticed that some drivers use `spinlock` + `irqsave` 
+ `tx fifo polling` to implement `up_putc()`:
   
https://github.com/apache/nuttx/blob/master/drivers/serial/uart_pl011.c#L671-L679
   For the current workaround, I think it might be more profitable to make 
similar changes in `up_putc()`, since we're not entirely sure if there's other 
code calling `up_putc()`.



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