casaroli commented on code in PR #20591:
URL: https://github.com/apache/nuttx/pull/20591#discussion_r4254627448


##########
drivers/serial/uart_pl011.c:
##########
@@ -743,17 +743,24 @@ static void pl011_txint(FAR struct uart_dev_s *dev, bool 
enable)
   FAR struct pl011_uart_port_s *sport = dev->priv;
   irqstate_t flags;
 
-  flags = spin_lock_irqsave(&sport->lock);

Review Comment:
   uart_xmitchars() calls pl011_send(), and pl011_send() takes sport->lock 
(line 681). If the lock is still held there, the CPU waits for itself, because 
the spinlock is not recursive. So the lock covers only the register write, and 
enter_critical_section() covers uart_xmitchars().



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