All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] serial: pl011: Resend the character if FIFO is full in debug uart
@ 2021-07-19  7:36 Chen Baozi
  2021-07-20 18:33 ` Simon Glass
  2021-07-24 20:41 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Chen Baozi @ 2021-07-19  7:36 UTC (permalink / raw)
  To: u-boot; +Cc: Simon Glass, Tom Rini, Stefan Roese

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>
---
 drivers/serial/serial_pl01x.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index 76b96ad414..8ff19acf33 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -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
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] serial: pl011: Resend the character if FIFO is full in debug uart
  2021-07-19  7:36 [PATCH v2] serial: pl011: Resend the character if FIFO is full in debug uart Chen Baozi
@ 2021-07-20 18:33 ` Simon Glass
  2021-07-24 20:41 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2021-07-20 18:33 UTC (permalink / raw)
  To: chenbaozi; +Cc: U-Boot Mailing List, Tom Rini, Stefan Roese

On Mon, 19 Jul 2021 at 01:36, Chen Baozi <chenbaozi@phytium.com.cn> wrote:
>
> 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>
> ---
>  drivers/serial/serial_pl01x.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] serial: pl011: Resend the character if FIFO is full in debug uart
  2021-07-19  7:36 [PATCH v2] serial: pl011: Resend the character if FIFO is full in debug uart Chen Baozi
  2021-07-20 18:33 ` Simon Glass
@ 2021-07-24 20:41 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2021-07-24 20:41 UTC (permalink / raw)
  To: Chen Baozi; +Cc: u-boot, Simon Glass, Stefan Roese

[-- Attachment #1: Type: text/plain, Size: 426 bytes --]

On Mon, Jul 19, 2021 at 03:36:04PM +0800, Chen Baozi wrote:

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

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-24 20:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-19  7:36 [PATCH v2] serial: pl011: Resend the character if FIFO is full in debug uart Chen Baozi
2021-07-20 18:33 ` Simon Glass
2021-07-24 20:41 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.