[PATCH] serial: pl011: Resend the character if FIFO is full in debug uart

Chen Baozi chenbaozi at phytium.com.cn
Sun Jul 18 10:36:55 CEST 2021


pl01x_putc() might return -EAGAIN if there was no space in FIFO. In that
case, high-level caller should wait until there is space and resend the
character.

Signed-off-by: Chen Baozi <chenbaozi at phytium.com.cn>
---
 drivers/serial/serial_pl01x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index 76b96ad414..17b26aed81 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -417,7 +417,7 @@ static inline void _debug_uart_putc(int ch)
 {
 	struct pl01x_regs *regs = (struct pl01x_regs *)CONFIG_DEBUG_UART_BASE;
 
-	pl01x_putc(regs, ch);
+	while (pl01x_putc(regs, ch) == -EAGAIN);
 }
 
 DEBUG_UART_FUNCS
-- 
2.28.0



More information about the U-Boot mailing list