linux-stable/drivers/tty/serial
Zhiyong Tao 7c4a509d38 serial: 8250_mtk: fix uart corruption issue when rx power off
Fix uart corruption issue when rx power off.
Add spin lock in mtk8250_dma_rx_complete function in APDMA mode.

when uart is used as a communication port with external device(GPS).
when external device(GPS) power off, the power of rx pin is also from
1.8v to 0v. Even if there is not any data in rx. But uart rx pin can
capture the data "0".
If uart don't receive any data in specified cycle, uart will generates
BI(Break interrupt) interrupt.
If external device(GPS) power off, we found that BI interrupt appeared
continuously and very frequently.
When uart interrupt type is BI, uart IRQ handler(8250 framwork
API:serial8250_handle_irq) will push data to tty buffer.
mtk8250_dma_rx_complete is a task of mtk_uart_apdma_rx_handler.
mtk8250_dma_rx_complete priority is lower than uart irq
handler(serial8250_handle_irq).
if we are in process of mtk8250_dma_rx_complete, uart appear BI
interrupt:1)serial8250_handle_irq will priority execution.2)it may cause
write tty buffer conflict in mtk8250_dma_rx_complete.
So the spin lock protect the rx receive data process is not break.

Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210729084640.17613-2-zhiyong.tao@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-07-29 17:06:37 +02:00
..
8250 serial: 8250_mtk: fix uart corruption issue when rx power off 2021-07-29 17:06:37 +02:00
cpm_uart tty: make use of tty_get_{char,frame}_size 2021-06-15 14:03:27 +02:00
jsm Merge 5.12-rc6 into tty-next 2021-04-05 08:59:21 +02:00
21285.c
altera_jtaguart.c serial: altera_jtaguart: drop low-latency workaround 2021-04-22 12:09:24 +02:00
altera_uart.c serial: altera_uart: drop low-latency workaround 2021-04-22 12:09:24 +02:00
amba-pl010.c serial: amba-pl010: drop low-latency workaround 2021-04-22 12:09:24 +02:00
amba-pl011.c serial: drop irq-flags initialisations 2021-05-20 16:24:05 +02:00
amba-pl011.h
apbuart.c serial: apbuart: drop low-latency workaround 2021-04-22 12:09:25 +02:00
apbuart.h
ar933x_uart.c serial: ar933x: drop low-latency workaround 2021-04-22 12:09:25 +02:00
arc_uart.c tty: cumulate and document tty_struct::flow* members 2021-05-13 16:57:16 +02:00
atmel_serial.c tty: serial: atmel: include <linux/io.h> instead of <asm/io.h> 2021-05-13 18:29:11 +02:00
atmel_serial.h
bcm63xx_uart.c serial: bcm63xx: drop low-latency workaround 2021-04-22 12:09:25 +02:00
clps711x.c
digicolor-usart.c
dz.c tty: serial: dz: include <linux/io.h> instead of <asm/io.h> 2021-05-13 18:29:11 +02:00
dz.h
earlycon-arm-semihost.c
earlycon-riscv-sbi.c
earlycon.c earlycon: simplify earlycon-table implementation 2020-12-04 15:49:48 +01:00
fsl_linflexuart.c tty: serial: linflexuart: Remove unnecessary '|' operation and add error count 2020-11-06 17:12:30 +01:00
fsl_lpuart.c tty: serial: fsl_lpuart: fix the wrong return value in lpuart32_get_mctrl 2021-07-29 17:05:59 +02:00
icom.c tty: serial: icom: include <linux/io.h> instead of <asm/io.h> 2021-05-13 18:29:11 +02:00
icom.h
imx.c serial: imx: Add DMA buffer configuration via DT 2021-06-04 15:11:16 +02:00
imx_earlycon.c
ip22zilog.c tty: serial: ip22zilog: include <linux/io.h> instead of <asm/io.h> 2021-05-13 18:29:12 +02:00
ip22zilog.h
Kconfig Revert "tty: serial: Add UART driver for Cortina-Access platform" 2021-06-24 14:46:32 +02:00
kgdb_nmi.c serial: kgdb_nmi: remove redundant initialization of variable c 2021-05-20 16:22:09 +02:00
kgdboc.c
lantiq.c tty/serial/lantiq: convert comma to semicolon 2020-12-28 16:10:50 +01:00
liteuart.c serial: liteuart: Add support for earlycon 2021-05-20 16:35:01 +02:00
lpc32xx_hs.c serial: lpc32xx_hs: drop low-latency workaround 2021-04-22 12:09:25 +02:00
Makefile Revert "tty: serial: Add UART driver for Cortina-Access platform" 2021-06-24 14:46:32 +02:00
max310x.c serial: max310x: Unprepare and disable clock in error path 2021-07-21 12:51:54 +02:00
max3100.c tty_port: drop last traces of low_latency 2021-01-07 16:17:32 +01:00
mcf.c serial: mcf: drop low-latency workaround 2021-04-22 12:09:25 +02:00
men_z135_uart.c
meson_uart.c tty: serial: meson: retrieve port FIFO size from DT 2021-05-20 16:11:20 +02:00
milbeaut_usio.c
mpc52xx_uart.c serial: mpc52xx_uart: drop low-latency workaround 2021-04-22 12:09:25 +02:00
mps2-uart.c
msm_serial.c serial: msm_serial: drop low-latency workaround 2021-04-22 12:09:25 +02:00
mux.c tty: serial: mux: include <linux/io.h> instead of <asm/io.h> 2021-05-13 18:29:12 +02:00
mvebu-uart.c serial: mvebu-uart: remove unused member nb from struct mvebu_uart 2021-06-25 13:53:51 +02:00
mxs-auart.c tty: make use of tty_get_{char,frame}_size 2021-06-15 14:03:27 +02:00
omap-serial.c serial: drop irq-flags initialisations 2021-05-20 16:24:05 +02:00
owl-uart.c serial: owl: drop low-latency workaround 2021-04-22 12:09:25 +02:00
pch_uart.c serial: pch_uart: fix build error with !CONFIG_DEBUG_FS 2021-03-23 10:31:09 +01:00
pic32_uart.c
pic32_uart.h
pmac_zilog.c tty: serial: pmac_zilog: include <linux/io.h> insteiad of <asm/io.h> 2021-05-13 18:29:12 +02:00
pmac_zilog.h tty: serial: pmac_zilog: Remove unused disposable variable 'garbage' 2020-11-13 15:28:27 +01:00
pxa.c
qcom_geni_serial.c serial: qcom_geni_serial: use DT aliases according to DT bindings 2021-06-24 14:51:28 +02:00
rda-uart.c serial: rda: drop low-latency workaround 2021-04-22 12:09:26 +02:00
rp2.c serial: rp2: use 'request_firmware' instead of 'request_firmware_nowait' 2021-05-21 20:34:02 +02:00
sa1100.c serial: sa1100: drop low-latency workaround 2021-04-22 12:09:26 +02:00
samsung_tty.c tty: serial: samsung_tty: remove set but not used variables 2021-05-13 16:10:53 +02:00
sb1250-duart.c tty: serial: sb1250-duart: include <linux/io.h> instead of <asm/io.h> 2021-05-13 18:29:12 +02:00
sc16is7xx.c serial: sc16is7xx: Use devm_clk_get_optional() 2021-05-20 16:30:40 +02:00
sccnxp.c
serial-tegra.c serial: tegra: Only print FIFO error message when an error occurs 2021-07-21 12:53:00 +02:00
serial_core.c tty: make tty_get_{char,frame}_size available 2021-06-15 14:03:26 +02:00
serial_mctrl_gpio.c
serial_mctrl_gpio.h
serial_txx9.c tty: serial: txx9: include <linux/io.h> instead of <asm/io.h> 2021-05-13 18:29:12 +02:00
sh-sci.c tty: make use of tty_get_{char,frame}_size 2021-06-15 14:03:27 +02:00
sh-sci.h serial: sh-sci: Add support for RZ/G2L SoC 2021-06-04 15:12:40 +02:00
sifive.c serial: sifive: drop low-latency workaround 2021-04-22 12:09:26 +02:00
sprd_serial.c
st-asc.c tty: serial: st-asc: Demote a kernel-doc formatting abuse 2021-05-20 17:06:17 +02:00
stm32-usart.c tty: make use of tty_get_{char,frame}_size 2021-06-15 14:03:27 +02:00
stm32-usart.h serial: stm32: add FIFO threshold configuration 2021-04-22 12:11:25 +02:00
suncore.c
sunhv.c
sunsab.c tty: serial: sunsab: include <linux/io.h> instead of <asm/io.h> 2021-05-13 18:29:12 +02:00
sunsab.h
sunsu.c tty: serial: sunsu: include <linux/io.h> instead of <asm/io.h> 2021-05-13 18:29:12 +02:00
sunzilog.c tty: serial: sunzilog: include <linux/io.h> instead of <asm/io.h> 2021-05-13 18:29:12 +02:00
sunzilog.h
tegra-tcu.c serial: tegra-tcu: Reorder channel initialization 2021-06-15 14:02:06 +02:00
timbuart.c serial: timbuart: drop low-latency workaround 2021-04-22 12:09:26 +02:00
timbuart.h
uartlite.c serial: tty: uartlite: fix console setup 2021-06-04 15:11:45 +02:00
ucc_uart.c firmware: replace HOTPLUG with UEVENT in FW_ACTION defines 2021-05-13 16:14:45 +02:00
vr41xx_siu.c tty: serial: vr41xx_siu: include <linux/io.h> instead of <asm/io.h> 2021-05-13 18:29:12 +02:00
vt8500_serial.c serial: vt8500: drop low-latency workaround 2021-04-22 12:09:26 +02:00
xilinx_uartps.c serial: Prefer unsigned int to bare use of unsigned 2021-06-24 14:51:45 +02:00
zs.c
zs.h