1
0
Fork 0
alistair23-linux/drivers/tty
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
..
hvc tty: hvcs: Don't NULL tty->driver_data until hvcs_cleanup() 2020-10-29 09:57:38 +01:00
ipwireless tty: ipwireless: fix error handling 2020-10-29 09:58:08 +01:00
serdev serdev: ttyport: restore client ops on deregistration 2020-02-28 17:22:19 +01:00
serial serial: mvebu-uart: fix tx lost characters at power off 2021-01-27 11:47:50 +01:00
vt vt: Disable KD_FONT_OP_COPY 2020-11-10 12:37:31 +01:00
Kconfig
Makefile
amiserial.c
cyclades.c
ehv_bytechan.c tty: evh_bytechan: Fix out of bounds accesses 2020-04-23 10:36:44 +02:00
goldfish.c
isicom.c
mips_ejtag_fdc.c
moxa.c
moxa.h
mxser.c
mxser.h
n_gsm.c tty: n_gsm: Fix bogus i++ in gsm_data_kick 2020-06-24 17:50:29 +02:00
n_hdlc.c
n_null.c
n_r3964.c
n_tracerouter.c
n_tracesink.c
n_tracesink.h
n_tty.c
nozomi.c
pty.c pty: do tty_flip_buffer_push without port->lock in pty_write 2020-10-29 09:57:38 +01:00
rocket.c tty: rocket, avoid OOB access 2020-04-29 16:33:17 +02:00
rocket.h
rocket_int.h
synclink.c
synclink_gt.c tty: synclink_gt: Adjust indentation in several functions 2020-02-24 08:36:47 +01:00
synclinkmp.c tty: synclinkmp: Adjust indentation in several functions 2020-02-24 08:36:47 +01:00
sysrq.c
tty_audit.c
tty_baudrate.c
tty_buffer.c
tty_io.c tty: Fix ->session locking 2020-12-11 13:23:28 +01:00
tty_ioctl.c
tty_jobctrl.c tty: Fix ->session locking 2020-12-11 13:23:28 +01:00
tty_ldisc.c
tty_ldsem.c
tty_mutex.c
tty_port.c serdev: ttyport: restore client ops on deregistration 2020-02-28 17:22:19 +01:00
ttynull.c
vcc.c sparc64: vcc: Fix error return code in vcc_probe() 2020-10-01 13:17:57 +02:00