patch "serial: apbuart: fix console prompt on qemu" added to tty-testing
This is a note to let you know that I've just added the patch titled
serial: apbuart: fix console prompt on qemu
to my tty git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
in the tty-testing branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will be merged to the tty-next branch sometime soon, after it passes testing, and the merge window is open.
If you have any questions about this process, please let me know.
From c6dcd8050fb7c2efec6946ae9c49bc186b0a7475 Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <[email protected]>
Date: Tue, 26 Dec 2023 13:16:07 +0100
Subject: serial: apbuart: fix console prompt on qemu
When using a leon kernel with qemu there where no console prompt. The root cause is the handling of the fifo size in the tx part of the apbuart driver.
The qemu uart driver only have a very rudimentary status handling and do not report the number of chars queued in the tx fifo in the status register. So the driver ends up with a fifo size of 1.
In the tx path the fifo size is divided by 2 - resulting in a fifo size of zero.
The original implementation would always try to send one char, but after the introduction of uart_port_tx_limited() the fifo size is respected even for the first char.
There seems to be no good reason to divide the fifo size with two - so remove this. It looks like something copied from the original amba driver.
With qemu we now have a minimum fifo size of one char, so we show the prompt.
--- drivers/tty/serial/apbuart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/apbuart.c +1 -1
@@ -122,7 +122,7 @@ static void apbuart_tx_chars(struct uart_port *port) {u8 ch; -uart_port_tx_limited (port, ch, port->fifosize >>1 , +uart_port_tx_limited (port, ch, port->fifosize, true,UART_PUT_CHAR (port, ch), ({}));
Signature · 1 line
2.43.0