diff mbox series

[v4,3/5] serial/8250: Use tx_loadsz as the transmitter fifo size

Message ID 20220316143646.13301-4-wander@redhat.com
State New
Headers show
Series tty/8250: Use fifo in 8250 console driver | expand

Commit Message

Wander Lairson Costa March 16, 2022, 2:36 p.m. UTC
Using port_fifosize as the fifo size to transmit data to the serial
console causes data loss in some controllers. Use the correct tx_loadsz
field.

Thanks to Jon Hunter for reporting the issue.

Reported-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Fixes: 5021d709b31b ("tty: serial: Use fifo in 8250 console driver")
Signed-off-by: Wander Lairson Costa <wander@redhat.com>
---
 drivers/tty/serial/8250/8250_port.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index 9f3fa9fe2a4e..d3a93e5d55f7 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -3343,7 +3343,7 @@  static void serial8250_console_fifo_write(struct uart_8250_port *up,
 {
 	int i;
 	const char *end = s + count;
-	unsigned int fifosize = up->port.fifosize;
+	unsigned int fifosize = up->tx_loadsz;
 	bool cr_sent = false;
 
 	while (s != end) {
@@ -3409,7 +3409,7 @@  void serial8250_console_write(struct uart_8250_port *up, const char *s,
 	}
 
 	use_fifo = (up->capabilities & UART_CAP_FIFO) &&
-		port->fifosize > 1 &&
+		up->tx_loadsz > 1 &&
 		(up->fcr & UART_FCR_ENABLE_FIFO) &&
 		/*
 		 * After we put a data in the fifo, the controller will send