]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
serial: pl011: Resend the character if FIFO is full in debug uart
authorChen Baozi <chenbaozi@phytium.com.cn>
Mon, 19 Jul 2021 07:36:04 +0000 (15:36 +0800)
committerTom Rini <trini@konsulko.com>
Fri, 23 Jul 2021 22:53:46 +0000 (18:53 -0400)
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@phytium.com.cn>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/serial/serial_pl01x.c

index 76b96ad414c419269255110fdc3a7d2d8211c072..8ff19acf335918be63d89a48b256c90c0b3e8a52 100644 (file)
@@ -417,7 +417,8 @@ 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