[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220316143646.13301-4-wander@redhat.com>
Date: Wed, 16 Mar 2022 11:36:42 -0300
From: Wander Lairson Costa <wander@...hat.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Wander Lairson Costa <wander@...hat.com>,
Johan Hovold <johan@...nel.org>,
"Maciej W. Rozycki" <macro@...am.me.uk>,
Lukas Wunner <lukas@...ner.de>,
Pali Rohár <pali@...nel.org>,
linux-serial@...r.kernel.org (open list:SERIAL DRIVERS),
linux-kernel@...r.kernel.org (open list)
Cc: rostedt@...dmis.org, senozhatsky@...omium.org,
andre.goddard@...il.com, sudipm.mukherjee@...il.com,
andy.shevchenko@...il.com, David.Laight@...lab.com,
jonathanh@...dia.com, phil@...pberrypi.com
Subject: [PATCH v4 3/5] serial/8250: Use tx_loadsz as the transmitter fifo size
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@...dia.com>
Tested-by: Jon Hunter <jonathanh@...dia.com>
Fixes: 5021d709b31b ("tty: serial: Use fifo in 8250 console driver")
Signed-off-by: Wander Lairson Costa <wander@...hat.com>
---
drivers/tty/serial/8250/8250_port.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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
--
2.35.1
Powered by blists - more mailing lists