Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: 8250_early: confirm empty transmitter after sending characters

The current code waits until the transmitter becomes empty,
before sending each character, and after finishing the whole string.
This seems a bit redundant.

It can be more efficient by checking the transmitter only after sending
each character. This should be safe because the transmitter is already
empty at the first entry of serial_putc().

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Masahiro Yamada and committed by
Greg Kroah-Hartman
f2bfdb06 2cda227b

+1 -4
+1 -4
drivers/tty/serial/8250/8250_early.c
··· 87 87 88 88 static void __init serial_putc(struct uart_port *port, int c) 89 89 { 90 - wait_for_xmitr(port); 91 90 serial8250_early_out(port, UART_TX, c); 91 + wait_for_xmitr(port); 92 92 } 93 93 94 94 static void __init early_serial8250_write(struct console *console, ··· 98 98 struct uart_port *port = &device->port; 99 99 100 100 uart_console_write(port, s, count, serial_putc); 101 - 102 - /* Wait for transmitter to become empty */ 103 - wait_for_xmitr(port); 104 101 } 105 102 106 103 static void __init init_port(struct earlycon_device *device)