History

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().

Masahiro Yamada committed 11 years ago

Commit f2bfdb01 parent 2cda2271 file · +1 −4Browse files

Unified · Split

drivers/tty/serial/8250/8250_early.c+1−4
@@ -87,8 +87,8 @@ static void __init wait_for_xmitr(struct uart_port *port) · 86 unmodified lines
87 87
88static void __init serial_putc(struct uart_port *port, int c)88static void __init serial_putc(struct uart_port *port, int c)
89{89{
90 wait_for_xmitr(port);
91 serial8250_early_out(port, UART_TX, c);90 serial8250_early_out(port, UART_TX, c);
91 wait_for_xmitr(port);
92}92}
93 93
94static void __init early_serial8250_write(struct console *console,94static void __init early_serial8250_write(struct console *console,
@@ -98,9 +98,6 @@ static void __init early_serial8250_write(struct console *console, · 3 unmodified lines
98 struct uart_port *port = &device->port;98 struct uart_port *port = &device->port;
99 99
100 uart_console_write(port, s, count, serial_putc);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
106static void __init init_port(struct earlycon_device *device)103static void __init init_port(struct earlycon_device *device)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t