linux/drivers/tty/serial
Sam Ravnborg b695460641 serial: apbuart: fix console prompt on qemu
[ Upstream commit c6dcd8050f ]

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.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Fixes: d11cc8c3c4 ("tty: serial: use uart_port_tx_limited()")
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc:  <linux-serial@vger.kernel.org>
Cc:  <sparclinux@vger.kernel.org>
Link: https://lore.kernel.org/r/20231226121607.GA2622970@ravnborg.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-01-25 15:45:24 -08:00
..
8250 serial: 8250: omap: Don't skip resource freeing if pm_runtime_resume_and_get() failed 2024-01-25 15:45:20 -08:00
jsm serial: jsm: Use port lock wrappers 2023-09-18 11:18:11 +02:00
21285.c serial: 21285: Use port lock wrappers 2023-09-18 11:18:08 +02:00
altera_jtaguart.c serial: altera_jtaguart: Use port lock wrappers 2023-09-18 11:18:09 +02:00
altera_uart.c serial: altera_uart: Use port lock wrappers 2023-09-18 11:18:09 +02:00
amba-pl010.c serial: amba-pl010: Use port lock wrappers 2023-09-18 11:18:09 +02:00
amba-pl011.c ARM: PL011: Fix DMA support 2023-11-23 20:22:46 +00:00
apbuart.c serial: apbuart: fix console prompt on qemu 2024-01-25 15:45:24 -08:00
apbuart.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ar933x_uart.c serial: ar933x: Use port lock wrappers 2023-09-18 11:18:10 +02:00
arc_uart.c serial: arc_uart: Use port lock wrappers 2023-09-18 11:18:10 +02:00
atmel_serial.c serial: atmel: Use port lock wrappers 2023-09-18 11:18:10 +02:00
atmel_serial.h tty: serial: atmel: Use FIELD_PREP/FIELD_GET 2022-09-22 16:32:25 +02:00
bcm63xx_uart.c serial: bcm63xx-uart: Use port lock wrappers 2023-09-18 11:18:10 +02:00
clps711x.c serial: clps711x: Use devm_platform_get_and_ioremap_resource() 2023-07-25 20:25:52 +02:00
cpm_uart.c serial: cpm_uart: Use port lock wrappers 2023-09-18 11:18:10 +02:00
cpm_uart.h serial: cpm_uart: Remove cpm_uart/ subdirectory 2023-08-04 15:08:30 +02:00
digicolor-usart.c serial: digicolor: Use port lock wrappers 2023-09-18 11:18:10 +02:00
dz.c serial: dz: Use port lock wrappers 2023-09-18 11:18:11 +02:00
dz.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
earlycon-riscv-sbi.c serial: make uart_console_write->putchar()'s character an unsigned char 2022-03-03 15:06:31 +01:00
earlycon-semihost.c serial: Rename earlycon semihost driver 2023-01-19 14:58:19 +01:00
earlycon.c earlycon: Let users set the clock frequency 2023-01-19 14:56:44 +01:00
esp32_acm.c drivers/tty/serial: add ESP32S3 ACM gadget driver 2023-10-16 20:18:15 +02:00
esp32_uart.c serial/esp32_uart: use prescaler when available 2023-10-21 18:26:14 +02:00
fsl_linflexuart.c serial: linflexuart: Use port lock wrappers 2023-09-18 11:18:11 +02:00
fsl_lpuart.c serial: fsl_lpuart: Use port lock wrappers 2023-09-18 11:18:11 +02:00
icom.c serial: icom: Use port lock wrappers 2023-09-18 11:18:11 +02:00
imx.c serial: imx: Correct clock error message in function probe() 2024-01-25 15:45:24 -08:00
imx_earlycon.c serial: make uart_console_write->putchar()'s character an unsigned char 2022-03-03 15:06:31 +01:00
ip22zilog.c serial: ip22zilog: Use port lock wrappers 2023-09-18 11:18:11 +02:00
ip22zilog.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig drivers/tty/serial: add ESP32S3 ACM gadget driver 2023-10-16 20:18:15 +02:00
kgdb_nmi.c tty: make tty_operations::write()'s count size_t 2023-08-11 21:12:46 +02:00
kgdboc.c tty: serial: kgdboc: fix mutex locking order for configure_kgdboc() 2023-01-16 16:44:53 +01:00
lantiq.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
liteuart.c serial: liteuart: Use port lock wrappers 2023-09-18 11:18:11 +02:00
lpc32xx_hs.c serial: lpc32xx_hs: Use port lock wrappers 2023-09-18 11:18:11 +02:00
ma35d1_serial.c serial: ma35d1: Validate console index before assignment 2023-12-07 10:48:45 +09:00
Makefile drivers/tty/serial: add ESP32S3 ACM gadget driver 2023-10-16 20:18:15 +02:00
max310x.c serial: max310x: remove trailing whitespaces 2023-10-16 20:13:10 +02:00
max3100.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
mcf.c serial: mcf: Use port lock wrappers 2023-09-18 11:18:12 +02:00
men_z135_uart.c serial: men_z135_uart: Use port lock wrappers 2023-09-18 11:18:12 +02:00
meson_uart.c tty: serial: meson: fix hard LOCKUP on crtscts mode 2023-10-17 10:17:01 +02:00
milbeaut_usio.c serial: milbeaut_usio: Use port lock wrappers 2023-09-18 11:18:12 +02:00
mpc52xx_uart.c serial: mpc52xx: Use port lock wrappers 2023-09-18 11:18:12 +02:00
mps2-uart.c serial: mps2-uart: Use port lock wrappers 2023-09-18 11:18:12 +02:00
msm_serial.c serial: msm: Use port lock wrappers 2023-09-18 11:18:12 +02:00
mux.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
mvebu-uart.c serial: mvebu-uart: Use port lock wrappers 2023-09-18 11:18:12 +02:00
mxs-auart.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
omap-serial.c serial: omap: do not override settings for RS485 support 2024-01-25 15:45:12 -08:00
owl-uart.c serial: owl: Use port lock wrappers 2023-09-18 11:18:13 +02:00
pch_uart.c serial: pch: Use port lock wrappers 2023-09-18 11:18:13 +02:00
pic32_uart.c serial: pic32: Use port lock wrappers 2023-09-18 11:18:13 +02:00
pmac_zilog.c serial: pmac_zilog: Use port lock wrappers 2023-09-18 11:18:13 +02:00
pmac_zilog.h serial: pmac_zilog: remove unused uart_pmac_port::termios_cache 2022-05-19 18:23:19 +02:00
pxa.c serial: pxa: Use port lock wrappers 2023-09-18 11:18:13 +02:00
qcom_geni_serial.c serial: qcom-geni: Use port lock wrappers 2023-09-18 11:18:13 +02:00
rda-uart.c serial: rda: Use port lock wrappers 2023-09-18 11:18:13 +02:00
rp2.c serial: rp2: Use port lock wrappers 2023-09-18 11:18:14 +02:00
sa1100.c serial: sa1100: Use port lock wrappers 2023-09-18 11:18:14 +02:00
samsung_tty.c tty: serial: samsung: drop earlycon support for unsupported platforms 2023-10-21 19:03:03 +02:00
sb1250-duart.c serial: sb1250-duart: Use port lock wrappers 2023-09-18 11:18:14 +02:00
sc16is7xx.c serial: sc16is7xx: set safe default SPI clock frequency 2024-01-25 15:45:17 -08:00
sccnxp.c serial: sccnxp: Use devm_platform_get_and_ioremap_resource() 2023-07-25 20:26:07 +02:00
serial-tegra.c serial: tegra: Use port lock wrappers 2023-09-18 11:18:14 +02:00
serial_base.h serial: core: Fix serial core port id, including multiport devices 2023-08-11 21:19:22 +02:00
serial_base_bus.c serial: core: Fix serial core port id, including multiport devices 2023-08-11 21:19:22 +02:00
serial_core.c serial: core, imx: do not set RS485 enabled if it is not supported 2024-01-25 15:45:12 -08:00
serial_ctrl.c serial: core: Start managing serial controllers to enable runtime PM 2023-05-31 10:46:59 +01:00
serial_mctrl_gpio.c serial: mctrl_gpio: Use port lock wrappers 2023-09-18 11:18:14 +02:00
serial_mctrl_gpio.h serial: mctrl_gpio: add a new API to enable / disable wake_irq 2022-02-08 11:07:16 +01:00
serial_port.c serial: core: Use port lock wrappers 2023-09-18 11:18:14 +02:00
serial_txx9.c serial: txx9: Use port lock wrappers 2023-09-18 11:18:14 +02:00
sh-sci.c serial: sh-sci: Use port lock wrappers 2023-09-18 11:18:15 +02:00
sh-sci.h tty: serial: sh-sci: Add support for tx end interrupt handling 2023-04-20 13:47:33 +02:00
sifive.c serial: sifive: Use port lock wrappers 2023-09-18 11:18:15 +02:00
sprd_serial.c serial: sprd: Use port lock wrappers 2023-09-18 11:18:15 +02:00
st-asc.c serial: st-asc: Use port lock wrappers 2023-09-18 11:18:15 +02:00
stm32-usart.c serial: Do not hold the port lock when setting rx-during-tx GPIO 2024-01-25 15:45:11 -08:00
stm32-usart.h serial: stm32: group dma pause/resume error handling into single function 2023-08-22 15:28:51 +02:00
suncore.c tty: Use of_node_name_{eq,prefix} for node name comparisons 2018-12-17 16:12:17 +01:00
sunhv.c serial: sunhv: Use port lock wrappers 2023-09-18 11:18:15 +02:00
sunplus-uart.c serial: sunplus-uart: Use port lock wrappers 2023-09-18 11:18:15 +02:00
sunsab.c serial: sunsab: Use port lock wrappers 2023-09-18 11:18:15 +02:00
sunsab.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sunsu.c serial: sunsu: Use port lock wrappers 2023-09-18 11:18:15 +02:00
sunzilog.c serial: sunzilog: Use port lock wrappers 2023-09-18 11:18:16 +02:00
sunzilog.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tegra-tcu.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
timbuart.c serial: timbuart: Use port lock wrappers 2023-09-18 11:18:16 +02:00
timbuart.h tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
uartlite.c serial: uartlite: Use port lock wrappers 2023-09-18 11:18:16 +02:00
ucc_uart.c serial: ucc_uart: Use port lock wrappers 2023-09-18 11:18:16 +02:00
vt8500_serial.c serial: vt8500: Use port lock wrappers 2023-09-18 11:18:16 +02:00
xilinx_uartps.c serial: xilinx_uartps: unset STOPBRK when setting STARTBRK 2023-10-16 20:14:42 +02:00
zs.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
zs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00