1
0
Fork 0
alistair23-linux/drivers/tty/serial
Pali Rohár 5eda5db39e serial: mvebu-uart: fix tx lost characters at power off
commit 54ca955b5a upstream.

Commit c685af1108 ("serial: mvebu-uart: fix tx lost characters") fixed tx
lost characters at low baud rates but started causing tx lost characters
when kernel is going to power off or reboot.

TX_EMP tells us when transmit queue is empty therefore all characters were
transmitted. TX_RDY tells us when CPU can send a new character.

Therefore we need to use different check prior transmitting new character
and different check after all characters were sent.

This patch splits polling code into two functions: wait_for_xmitr() which
waits for TX_RDY and wait_for_xmite() which waits for TX_EMP.

When rebooting A3720 platform without this patch on UART is print only:
[   42.699�

And with this patch on UART is full output:
[   39.530216] reboot: Restarting system

Fixes: c685af1108 ("serial: mvebu-uart: fix tx lost characters")
Signed-off-by: Pali Rohár <pali@kernel.org>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201223191931.18343-1-pali@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-27 11:47:50 +01:00
..
8250 serial: 8250_omap: Avoid FIFO corruption caused by MDR1 access 2020-12-21 13:27:06 +01:00
cpm_uart tty: cpm_uart: drop unused iflag macro 2019-05-24 10:09:16 +02:00
jsm tty: add SPDX identifiers to Kconfig and Makefiles 2019-04-04 18:48:43 +02:00
21285.c
Kconfig tty: serial: earlycon dependency 2020-10-29 09:57:37 +01:00
Makefile TTY/Serial driver changes for 5.4-rc1 2019-09-18 10:50:47 -07:00
altera_jtaguart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
altera_uart.c serial: altera: set RRDY flag also without irq 2018-02-28 13:30:09 +01:00
amba-pl010.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
amba-pl011.c serial: pl011: Fix lockdep splat when handling magic-sysrq interrupt 2020-11-01 12:01:06 +01:00
amba-pl011.h
apbuart.c
apbuart.h
ar933x_uart.c serial: ar933x_uart: set UART_CS_{RX,TX}_READY_ORIDE 2020-03-12 13:00:10 +01:00
arc_uart.c serial: arc_uart: Fix out-of-bounds access through DT alias 2018-02-28 15:29:59 +01:00
atmel_serial.c tty/serial: atmel: manage shutdown in case of RS485 or ISO7816 mode 2020-02-28 17:22:19 +01:00
atmel_serial.h tty/serial: atmel: add ISO7816 support 2018-10-02 13:38:55 -07:00
bcm63xx_uart.c MIPS changes for 4.15 2017-11-15 11:36:08 -08:00
clps711x.c serial: clps711x: Remove board support 2019-01-08 16:55:18 +01:00
digicolor-usart.c tty/serial: digicolor: Fix digicolor-usart already registered warning 2019-06-10 19:08:31 +02:00
dz.c
dz.h
earlycon-arm-semihost.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
earlycon-riscv-sbi.c tty/serial: use uart_console_write in the RISC-V SBL early console 2019-01-23 15:41:50 -08:00
earlycon.c earlycon: Remove hardcoded port->uartclk initialization in of_setup_earlycon 2018-05-14 13:41:05 +02:00
efm32-uart.c
fsl_linflexuart.c tty: serial: linflexuart: Fix magic SysRq handling 2019-10-04 15:02:28 +02:00
fsl_lpuart.c tty: serial: fsl_lpuart: LS1021A has a FIFO size of 16 words, like LS1028A 2020-11-10 12:37:33 +01:00
icom.c tty: serial: Remove call to memset after pci_alloc_consistent 2019-09-04 12:43:44 +02:00
icom.h tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
ifx6x60.c serial: ifx6x60: add missed pm_runtime_disable 2019-12-13 08:42:25 +01:00
ifx6x60.h tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
imx.c tty: serial: imx: keep console clocks always on 2020-11-24 13:29:20 +01:00
ip22zilog.c
ip22zilog.h
kgdb_nmi.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
kgdboc.c kgdboc: Use a platform device to handle tty drivers showing up late 2020-06-22 09:31:06 +02:00
lantiq.c serial: lantiq: Add support for Lightning Mountain SoC 2019-09-04 12:43:53 +02:00
lpc32xx_hs.c TTY/Serial driver changes for 5.4-rc1 2019-09-18 10:50:47 -07:00
max310x.c serial: max310x: turn off transmitter before activating AutoCTS or auto transmitter flow control 2019-09-05 09:57:44 +02:00
max3100.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
mcf.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
men_z135_uart.c drivers: Remove explicit invocations of mmiowb() 2019-04-08 12:01:02 +01:00
meson_uart.c tty: serial: meson: if no alias specified use an available id 2019-01-18 11:22:22 +01:00
milbeaut_usio.c serial: milbeaut_usio: Fix error handling in probe and remove 2019-04-29 16:20:24 +02:00
mpc52xx_uart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
mps2-uart.c serial: mps2-uart: Add parentheses around conditional in mps2_uart_shutdown 2019-01-31 19:34:10 +01:00
msm_serial.c tty: serial: msm_serial: Fix lockup for sysrq and oops 2020-01-09 10:20:05 +01:00
mux.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
mvebu-uart.c serial: mvebu-uart: fix tx lost characters at power off 2021-01-27 11:47:50 +01:00
mxs-auart.c serial: mxs-auart: add missed iounmap() in probe failure and remove 2020-07-22 09:33:11 +02:00
omap-serial.c tty: omap-serial: Fix initial on-boot RTS GPIO level 2018-01-09 16:45:17 +01:00
owl-uart.c tty: serial: owl: add "much needed" clk_prepare_enable() 2020-04-29 16:33:14 +02:00
pch_uart.c tty: serial: pch_uart: correct usage of dma_unmap_sg 2020-01-17 19:48:55 +01:00
pic32_uart.c serial: set suppress_bind_attrs flag only if builtin 2018-11-09 09:07:17 -08:00
pic32_uart.h tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
pmac_zilog.c tty: Use of_node_name_{eq,prefix} for node name comparisons 2018-12-17 16:12:17 +01:00
pmac_zilog.h
pnx8xxx_uart.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
pxa.c serial: pxa: Fix an error handling path in 'serial_pxa_probe()' 2018-06-28 21:07:54 +09:00
qcom_geni_serial.c serial: qcom_geni_serial: To correct QUP Version detection logic 2020-11-01 12:01:06 +01:00
rda-uart.c tty: serial: rda: Fix the link time qualifier of 'rda_uart_exit()' 2019-10-04 15:01:15 +02:00
rp2.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
sa1100.c serial: sa1100: add note about modem control signals 2019-06-04 12:56:33 +01:00
samsung.c tty: serial: samsung: Correct clock selection logic 2020-10-01 13:18:00 +02:00
samsung.h tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
sb1250-duart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
sc16is7xx.c Merge 5.1-rc6 into tty-next 2019-04-21 23:20:08 +02:00
sccnxp.c tty: Remove dev_err() usage after platform_get_irq() 2019-09-04 12:43:49 +02:00
serial-tegra.c serial: tegra: fix CREAD handling for PIO 2020-07-29 10:18:42 +02:00
serial_core.c serial_core: Check for port state when tty is in error state 2020-12-30 11:51:00 +01:00
serial_mctrl_gpio.c serial: mctrl_gpio: Check for NULL pointer 2019-10-07 13:21:54 +02:00
serial_mctrl_gpio.h serial: mctrl_gpio: Avoid probe failures in case of missing gpiolib 2019-09-04 12:43:50 +02:00
serial_txx9.c serial: txx9: add missing platform_driver_unregister() on error in serial_txx9_init 2020-11-10 12:37:32 +01:00
sh-sci.c serial: sh-sci: Make sure status register SCxSR is read in correct sequence 2020-04-29 16:33:24 +02:00
sh-sci.h serial: sh-sci: Support for HSCIF RX sampling point adjustment 2018-04-23 10:08:18 +02:00
sifive.c riscv: Fix sifive serial driver 2021-01-27 11:47:43 +01:00
sirfsoc_uart.c serial: sirf: Fix out-of-bounds access through DT alias 2018-02-28 15:30:00 +01:00
sirfsoc_uart.h tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
sprd_serial.c serial: sprd: Fix a dereference warning 2020-04-02 15:10:59 +02:00
st-asc.c tty: serial: simplify getting .drvdata 2018-04-22 17:29:43 +02:00
stm32-usart.c serial: stm32: avoid kernel warning on absence of optional IRQ 2020-09-03 11:27:03 +02:00
stm32-usart.h serial: stm32: add support of RX FIFO threshold 2019-06-21 11:17:36 +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 sunhv: Fix device naming inconsistency between sunhv_console and sunhv_reg 2019-06-13 14:04:37 -07:00
sunsab.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
sunsab.h
sunsu.c TTY/Serial driver patches for 4.21-rc1 2018-12-28 20:33:54 -08:00
sunzilog.c
sunzilog.h
tegra-tcu.c serial: Add Tegra Combined UART driver 2019-01-30 09:31:31 +01:00
timbuart.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
timbuart.h tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
uartlite.c serial: uartlite: fix exit path null pointer 2019-10-04 15:02:46 +02:00
ucc_uart.c docs: serial: move it to the driver-api 2019-07-15 11:03:03 -03:00
vr41xx_siu.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
vt8500_serial.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
xilinx_uartps.c serial: uartps: Wait for tx_empty in console setup 2020-10-01 13:17:55 +02:00
zs.c
zs.h