[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220316143646.13301-5-wander@redhat.com>
Date: Wed, 16 Mar 2022 11:36:43 -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>,
Serge Semin <fancer.lancer@...il.com>,
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 4/5] serial/8250: exclude BCM283x from console_fifo_write
>From Phil's original patch:
"""
The mini-UART on BCM283x is doubly crippled - it has 8-byte FIFOs and
the THRE bit indicates that the TX FIFO is not-full rather than empty.
The optimisation to enable the use of the FIFO assumes that it is safe
to write fifosize bytes whenever THRE is set, but the BCM283x quirk
(indicated by the presence of UART_CAP_MINI) makes it necessary to
check the FIFO state after each byte.
See: https://github.com/raspberrypi/linux/issues/4849
"""
Thanks to Phil Elwell for reporting the issue and providing the original
patch.
Reported-by: Phil Elwell <phil@...pberrypi.com>
Co-author: Phil Elwell <phil@...pberrypi.com>
Signed-off-by: Wander Lairson Costa <wander@...hat.com>
---
drivers/tty/serial/8250/8250_port.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index d3a93e5d55f7..4acf620be241 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -3409,6 +3409,11 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s,
}
use_fifo = (up->capabilities & UART_CAP_FIFO) &&
+ /*
+ * BCM283x requires to check the fifo
+ * after each byte.
+ */
+ !(up->capabilities & UART_CAP_MINI) &&
up->tx_loadsz > 1 &&
(up->fcr & UART_FCR_ENABLE_FIFO) &&
/*
--
2.35.1
Powered by blists - more mailing lists