WSL2-Linux-Kernel/drivers/tty/serial
Vladimir Oltean c97f2a6fb3 tty: serial: fsl_lpuart: LS1021A has a FIFO size of 16 words, like LS1028A
Prior to the commit that this one fixes, the FIFO size was derived from
the read-only register LPUARTx_FIFO[TXFIFOSIZE] using the following
formula:

TX FIFO size = 2 ^ (LPUARTx_FIFO[TXFIFOSIZE] - 1)

The documentation for LS1021A is a mess. Under chapter 26.1.3 LS1021A
LPUART module special consideration, it mentions TXFIFO_SZ and RXFIFO_SZ
being equal to 4, and in the register description for LPUARTx_FIFO, it
shows the out-of-reset value of TXFIFOSIZE and RXFIFOSIZE fields as "011",
even though these registers read as "101" in reality.

And when LPUART on LS1021A was working, the "101" value did correspond
to "16 datawords", by applying the formula above, even though the
documentation is wrong again (!!!!) and says that "101" means 64 datawords
(hint: it doesn't).

So the "new" formula created by commit f77ebb241c has all the premises
of being wrong for LS1021A, because it relied only on false data and no
actual experimentation.

Interestingly, in commit c2f448cff2 ("tty: serial: fsl_lpuart: add
LS1028A support"), Michael Walle applied a workaround to this by manually
setting the FIFO widths for LS1028A. It looks like the same values are
used by LS1021A as well, in fact.

When the driver thinks that it has a deeper FIFO than it really has,
getty (user space) output gets truncated.

Many thanks to Michael for pointing out where to look.

Fixes: f77ebb241c ("tty: serial: fsl_lpuart: correct the FIFO depth size")
Suggested-by: Michael Walle <michael@walle.cc>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20201023013429.3551026-1-vladimir.oltean@nxp.com
Reviewed-by:Fugang Duan <fugang.duan@nxp.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-28 13:40:25 +01:00
..
8250 serial: 8250_dw: Fix clk-notifier/port suspend deadlock 2020-09-30 14:52:42 +02:00
cpm_uart
jsm tty: serial: Replace HTTP links with HTTPS ones 2020-07-21 20:04:54 +02:00
21285.c tty: serial: 21285: fix lockup on open 2020-10-28 13:39:14 +01:00
Kconfig ARM: SoC platform updates 2020-10-24 10:33:08 -07:00
Makefile tty: serial: imx: add dependence and build for earlycon 2020-08-18 13:54:34 +02:00
altera_jtaguart.c serial: altera_jtaguart: Replace HTTP links with HTTPS ones 2020-07-21 20:04:54 +02:00
altera_uart.c
amba-pl010.c
amba-pl011.c serial: pl011: Fix lockdep splat when handling magic-sysrq interrupt 2020-09-30 14:31:04 +02:00
amba-pl011.h
apbuart.c
apbuart.h
ar933x_uart.c
arc_uart.c
atmel_serial.c Linux 5.9-rc3 2020-08-31 07:19:25 +02:00
atmel_serial.h
bcm63xx_uart.c
clps711x.c
digicolor-usart.c
dz.c
dz.h
earlycon-arm-semihost.c
earlycon-riscv-sbi.c
earlycon.c tty: serial: print earlycon info after match->setup 2020-09-16 13:16:20 +02:00
efm32-uart.c
fsl_linflexuart.c
fsl_lpuart.c tty: serial: fsl_lpuart: LS1021A has a FIFO size of 16 words, like LS1028A 2020-10-28 13:40:25 +01:00
icom.c tty: serial: icom: switch from 'pci_' to 'dma_' API 2020-09-04 18:07:20 +02:00
icom.h
ifx6x60.c tty: serial, fix kernel-doc 2020-08-18 13:51:18 +02:00
ifx6x60.h
imx.c tty: serial: imx: disable TXDC IRQ in imx_uart_shutdown() to avoid IRQ storm 2020-09-30 14:31:04 +02:00
imx_earlycon.c tty: serial: imx: add imx earlycon driver 2020-07-29 17:11:02 +02:00
ip22zilog.c
ip22zilog.h
kgdb_nmi.c
kgdboc.c
lantiq.c
lpc32xx_hs.c
max310x.c serial: max310x: rework RX interrupt handling 2020-10-01 10:57:50 +02:00
max3100.c
mcf.c serial: mcf: add sysrq capability 2020-10-05 13:32:30 +02:00
men_z135_uart.c tty: serial, fix kernel-doc 2020-08-18 13:51:18 +02:00
meson_uart.c
milbeaut_usio.c
mpc52xx_uart.c
mps2-uart.c
msm_serial.c serial: msm_serial: add sparse context annotation 2020-07-24 10:44:27 +02:00
mux.c
mvebu-uart.c serial: mvebu-uart: fix unused variable warning 2020-09-29 12:56:39 +02:00
mxs-auart.c
omap-serial.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
owl-uart.c
pch_uart.c pch_uart: drop double zeroing 2020-09-27 14:17:43 +02:00
pic32_uart.c
pic32_uart.h
pmac_zilog.c serial: pmac_zilog: use for_each_child_of_node() macro 2020-09-16 13:20:09 +02:00
pmac_zilog.h
pnx8xxx_uart.c
pxa.c
qcom_geni_serial.c serial: qcom_geni_serial: To correct QUP Version detection logic 2020-09-30 09:12:03 +02:00
rda-uart.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
rp2.c
sa1100.c serial: sa1100: use platform_get_resource() 2020-08-18 15:02:06 +02:00
samsung_tty.c serial: samsung: Removes the IRQ not found warning 2020-08-18 13:53:42 +02:00
sb1250-duart.c MIPS: Replace SIBYTE_1956_WAR by CONFIG_SB1_PASS_2_WORKAROUNDS 2020-09-07 22:24:51 +02:00
sc16is7xx.c sc16is7xx: Set iobase to device index 2020-09-04 17:14:47 +02:00
sccnxp.c
serial-tegra.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
serial_core.c Merge 5.9.0-rc6 into tty-next 2020-09-21 09:23:55 +02:00
serial_mctrl_gpio.c
serial_mctrl_gpio.h
serial_txx9.c
sh-sci.c Revert "serial: sh-sci: Initialize spinlock for uart console" 2020-07-21 18:21:49 +02:00
sh-sci.h
sifive.c Revert "tty: serial: add missing spin_lock_init for SiFive serial console" 2020-07-21 18:21:49 +02:00
sirfsoc_uart.c
sirfsoc_uart.h
sprd_serial.c
st-asc.c
stm32-usart.c serial: stm32: Add RS485 RTS GPIO control again 2020-09-04 17:16:40 +02:00
stm32-usart.h
suncore.c
sunhv.c Revert "serial: sunhv: Initialize lock for non-registered console" 2020-07-21 18:21:49 +02:00
sunsab.c
sunsab.h
sunsu.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
sunzilog.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
sunzilog.h
tegra-tcu.c
timbuart.c tty: timbuart: convert tasklets to use new tasklet_setup() API 2020-08-18 13:33:13 +02:00
timbuart.h
uartlite.c tty: serial: uartlite: Replace HTTP links with HTTPS ones 2020-07-21 20:04:54 +02:00
ucc_uart.c serial: ucc_uart: make qe_uart_set_mctrl() static 2020-09-16 13:14:58 +02:00
vr41xx_siu.c
vt8500_serial.c
xilinx_uartps.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
zs.c
zs.h