linux/drivers/tty/serial
Erwan Le Ray 6333a48506 serial: stm32: push DMA RX data before suspending
Data may be stored in DMA RX buffer, when suspending. The data needs
to be pushed to the upper layer. We can't rely on the timeout IRQ (RTOR)
that can't be triggered into low power state. So safely clear DMA request
(DMAR), force the DMA reception routines to push RX buffer content, before
disabling RX DMA. This way, handover to pio mode is safe.
Only call tty_flip_buffer_push() when there is RX data to handle.

Move the locking outside of stm32_usart_receive_chars() to prevent a race
condition, when disabling DMA request upon suspend / pm_runtime_suspend.
Data may be received under IRQ and pushed before
stm32_usart_receive_chars() has pushed older data from DMA rx_buf upon
suspend.
The sequence in suspend routine needs proper locking to avoid this.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Signed-off-by: Erwan Le Ray <erwan.leray@foss.st.com>
Link: https://lore.kernel.org/r/20211025134229.8456-4-erwan.leray@foss.st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-26 19:18:47 +02:00
..
8250 serial: 8250_pci: Remove empty stub pci_quatech_exit() 2021-10-26 19:18:10 +02:00
cpm_uart tty: make use of tty_get_{char,frame}_size 2021-06-15 14:03:27 +02:00
jsm tty: serial: jsm: hold port lock when reporting modem line changes 2021-07-21 12:36:48 +02:00
21285.c tty: serial: 21285: fix lockup on open 2020-10-28 13:39:14 +01:00
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 Revert "arm pl011 serial: support multi-irq request" 2021-08-16 18:52:08 +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: use macros instead of hardcoded values 2021-10-10 15:20:09 +02:00
atmel_serial.h tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
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 redundant check to simplify the code 2021-08-26 14:51:04 +02:00
fsl_lpuart.c tty: serial: fsl_lpuart: do software reset for imx7ulp and imx8qxp 2021-08-26 14:49:20 +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 tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
imx_earlycon.c tty: serial: imx: add imx earlycon driver 2020-07-29 17:11:02 +02:00
imx.c serial: imx: disable console clocks on unregister 2021-10-21 10:30:08 +02:00
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 tty: serial: samsung: describe driver in KConfig 2021-10-05 14:04:13 +02:00
kgdb_nmi.c tty: drop put_tty_driver 2021-07-27 12:17:21 +02:00
kgdboc.c Linux 5.8-rc6 2020-07-20 09:39:11 +02:00
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: Make max310x_remove() return void 2021-10-13 14:33:59 +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 tty: serial, fix kernel-doc 2020-08-18 13:51:18 +02:00
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 parisc: Make struct parisc_driver::remove() return void 2021-08-30 10:18:25 +02:00
mvebu-uart.c serial: mvebu-uart: fix driver's tx_empty callback 2021-09-14 10:07:10 +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: omap: Disable PM runtime autoidle to remove pm_runtime_irq_safe() 2021-07-29 17:03:04 +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 serial: pic32_uart: Use uart_console() helper 2020-03-12 10:00:22 +01:00
pic32_uart.h tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
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: Improve naming for common macro 2021-10-10 15:20:16 +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: Make sc16is7xx_remove() return void 2021-10-13 14:34:07 +02:00
sccnxp.c
serial_core.c serial: core: Fix initializing and restoring termios speed 2021-10-05 15:02:44 +02:00
serial_mctrl_gpio.c serial: mctrl_gpio: Fix passing zero to 'ERR_PTR' warning 2020-11-06 17:12:05 +01:00
serial_mctrl_gpio.h tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
serial_txx9.c tty: serial: txx9: include <linux/io.h> instead of <asm/io.h> 2021-05-13 18:29:12 +02:00
serial-tegra.c serial: tegra: Use of_device_get_match_data 2021-08-26 14:51:10 +02:00
sh-sci.c serial: sh-sci: fix break handling for sysrq 2021-08-16 18:53:40 +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: set pointer to NULL rather than 0. 2021-10-05 14:54:21 +02:00
sprd_serial.c serial: sprd: remove redundant sprd_port cleanup 2020-03-18 12:20:04 +01:00
st-asc.c tty: serial: st-asc: Demote a kernel-doc formatting abuse 2021-05-20 17:06:17 +02:00
stm32-usart.c serial: stm32: push DMA RX data before suspending 2021-10-26 19:18:47 +02:00
stm32-usart.h serial: stm32: update throttle and unthrottle ops for dma mode 2021-10-21 10:36:29 +02:00
suncore.c
sunhv.c Revert "serial: sunhv: Initialize lock for non-registered console" 2020-07-21 18:21:49 +02:00
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 serial: sunzilog: Mark sunzilog_putchar() __maybe_unused 2021-10-26 19:15:04 +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 tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
uartlite.c tty: serial: uartlite: Prevent changing fixed parameters 2021-09-14 10:05:32 +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: Use of_device_get_match_data 2021-08-26 14:51:10 +02:00
xilinx_uartps.c serial: xilinx_uartps: Fix race condition causing stuck TX 2021-10-26 19:17:05 +02:00
zs.c
zs.h