linux-stable/drivers/tty/serial
Tony Lindgren 81a61051e0 serial: core: Fix checks for tx runtime PM state
Maximilian reported that surface_serial_hub serdev tx does not work during
system suspend. During system suspend, runtime PM gets disabled in
__device_suspend_late(), and tx is unable to wake-up the serial core port
device that we use to check if tx is safe to start. Johan summarized the
regression noting that serdev tx no longer always works as earlier when the
serdev device is runtime PM active.

The serdev device and the serial core controller devices are siblings of
the serial port hardware device. The runtime PM usage count from serdev
device does not propagate to the serial core device siblings, it only
propagates to the parent.

In addition to the tx issue for suspend, testing for the serial core port
device can cause an unnecessary delay in enabling tx while waiting for the
serial core port device to wake-up. The serial core port device wake-up is
only needed to flush pending tx when the serial port hardware device was
in runtime PM suspended state.

To fix the regression, we need to check the runtime PM state of the parent
serial port hardware device for tx instead of the serial core port device.

As the serial port device drivers may or may not implement runtime PM, we
need to also add a check for pm_runtime_enabled().

Reported-by: Maximilian Luz <luzmaximilian@gmail.com>
Cc: stable <stable@kernel.org>
Fixes: 84a9582fd2 ("serial: core: Start managing serial controllers to enable runtime PM")
Signed-off-by: Tony Lindgren <tony@atomide.com>
Tested-by: Maximilian Luz <luzmaximilian@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231005075644.25936-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-10-07 11:23:47 +02:00
..
8250 serial: 8250_omap: Fix errors with no_console_suspend 2023-10-03 15:01:29 +02:00
jsm drivers: serial: jsm: fix some leaks in probe 2022-09-22 16:11:43 +02:00
21285.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
altera_jtaguart.c serial: altera_jtaguart: switch status to u32 2023-07-31 17:16:05 +02:00
altera_uart.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
amba-pl010.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
amba-pl011.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
apbuart.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
apbuart.h
ar933x_uart.c serial: ar933x: Use devm_platform_get_and_ioremap_resource() 2023-07-25 20:25:52 +02:00
arc_uart.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
atmel_serial.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
atmel_serial.h tty: serial: atmel: Use FIELD_PREP/FIELD_GET 2022-09-22 16:32:25 +02:00
bcm63xx_uart.c serial: bcm63xx-uart: Use devm_platform_get_and_ioremap_resource() 2023-07-25 20:25:52 +02:00
clps711x.c serial: clps711x: Use devm_platform_get_and_ioremap_resource() 2023-07-25 20:25:52 +02:00
cpm_uart.c serial: cpm_uart: Remove cpm_uart/ subdirectory 2023-08-04 15:08:30 +02:00
cpm_uart.h serial: cpm_uart: Remove cpm_uart/ subdirectory 2023-08-04 15:08:30 +02:00
digicolor-usart.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
dz.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
dz.h
earlycon-riscv-sbi.c
earlycon-semihost.c serial: Rename earlycon semihost driver 2023-01-19 14:58:19 +01:00
earlycon.c earlycon: Let users set the clock frequency 2023-01-19 14:56:44 +01:00
fsl_linflexuart.c serial: linflexuart: Use devm_platform_get_and_ioremap_resource() 2023-07-25 20:25:52 +02:00
fsl_lpuart.c Merge commit b320441c04 ("Merge tag 'tty-6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty") into tty-next 2023-08-20 14:29:37 +02:00
icom.c serial: Make ->set_termios() old ktermios const 2022-08-30 14:22:35 +02:00
imx.c serial: imx: Use devm_platform_get_and_ioremap_resource() 2023-07-25 20:26:07 +02:00
imx_earlycon.c
ip22zilog.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
ip22zilog.h
Kconfig TTY/Serial driver updates for 6.5-rc1. 2023-07-03 13:14:58 -07:00
kgdb_nmi.c tty: make tty_operations::write()'s count size_t 2023-08-11 21:12:46 +02:00
kgdboc.c tty: serial: kgdboc: fix mutex locking order for configure_kgdboc() 2023-01-16 16:44:53 +01:00
lantiq.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
liteuart.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
lpc32xx_hs.c tty: serial: use uart_port_tx() helper 2022-11-03 03:32:40 +01:00
ma35d1_serial.c tty: serial: Remove redundant initialization for ma35d1serial_driver 2023-08-03 09:51:46 +02:00
Makefile serial: cpm_uart: Remove cpm_uart/ subdirectory 2023-08-04 15:08:30 +02:00
max310x.c serial: max310x: fix typos in comments 2023-08-04 15:08:09 +02:00
max3100.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
mcf.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
men_z135_uart.c serial: men_z135_uart: Use uart_xmit_advance() 2022-11-03 03:35:41 +01:00
meson_uart.c Revert "tty: serial: meson: Add a earlycon for the T7 SoC" 2023-08-27 11:43:01 +02:00
milbeaut_usio.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
mpc52xx_uart.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
mps2-uart.c serial: mps2-uart: Use devm_platform_get_and_ioremap_resource() 2023-07-25 20:26:06 +02:00
msm_serial.c serial: msm: add lock annotation to msm_set_baud_rate() 2023-01-19 15:53:09 +01:00
mux.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
mvebu-uart.c serial: mvebu-uart: Use devm_platform_get_and_ioremap_resource() 2023-07-25 20:26:07 +02:00
mxs-auart.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
omap-serial.c TTY/Serial driver changes for 6.6-rc1 2023-09-01 09:38:00 -07:00
owl-uart.c tty: serial: use uart_port_tx() helper 2022-11-03 03:32:40 +01:00
pch_uart.c tty: pcn_uart: fix memory leak with using debugfs_lookup() 2023-02-08 13:09:55 +01:00
pic32_uart.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
pmac_zilog.c serial: pmac_zilog: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
pmac_zilog.h
pxa.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
qcom_geni_serial.c tty: serial: qcom-geni-serial: Poll primary sequencer irq status after cancel_tx 2023-08-09 14:15:28 +02:00
rda-uart.c serial: rda: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
rp2.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
sa1100.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
samsung_tty.c tty: serial: samsung: Set missing PM ops for hibernation support 2023-08-04 15:06:24 +02:00
sb1250-duart.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
sc16is7xx.c serial: sc16is7xx: add missing support for rs485 devicetree properties 2023-08-22 15:30:00 +02:00
sccnxp.c serial: sccnxp: Use devm_platform_get_and_ioremap_resource() 2023-07-25 20:26:07 +02:00
serial-tegra.c serial: tegra: handle clk prepare error in tegra_uart_hw_init() 2023-08-22 15:29:18 +02:00
serial_base.h serial: core: Fix serial core port id, including multiport devices 2023-08-11 21:19:22 +02:00
serial_base_bus.c serial: core: Fix serial core port id, including multiport devices 2023-08-11 21:19:22 +02:00
serial_core.c serial: core: Fix checks for tx runtime PM state 2023-10-07 11:23:47 +02:00
serial_ctrl.c serial: core: Start managing serial controllers to enable runtime PM 2023-05-31 10:46:59 +01:00
serial_mctrl_gpio.c
serial_mctrl_gpio.h
serial_port.c serial: core: Start managing serial controllers to enable runtime PM 2023-05-31 10:46:59 +01:00
serial_txx9.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
sh-sci.c Merge 6.5-rc4 into tty-next 2023-07-31 09:39:56 +02:00
sh-sci.h tty: serial: sh-sci: Add support for tx end interrupt handling 2023-04-20 13:47:33 +02:00
sifive.c serial: sifive: Add suspend and resume operations 2023-08-22 15:29:10 +02:00
sprd_serial.c serial: sprd: Fix DMA buffer leak issue 2023-07-30 13:53:55 +02:00
st-asc.c drivers:tty: fix return value check in asc_init_port 2023-07-30 13:53:19 +02:00
stm32-usart.c serial: stm32: synchronize RX DMA channel in shutdown 2023-08-22 15:28:51 +02:00
stm32-usart.h serial: stm32: group dma pause/resume error handling into single function 2023-08-22 15:28:51 +02:00
suncore.c
sunhv.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
sunplus-uart.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
sunsab.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
sunsab.h
sunsu.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
sunzilog.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
sunzilog.h
tegra-tcu.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
timbuart.c serial: timbuart: Use uart_xmit_advance() 2022-11-03 03:35:43 +01:00
timbuart.h
uartlite.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
ucc_uart.c serial: cpm_uart: Don't include fs_uart_pd.h when not needed 2023-08-04 15:08:55 +02:00
vt8500_serial.c serial: vt8500: Use devm_platform_get_and_ioremap_resource() 2023-07-25 20:26:06 +02:00
xilinx_uartps.c tty: serial: xilinx_uartps: Do not check for 0 return after calling platform_get_irq() 2023-08-04 15:06:01 +02:00
zs.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
zs.h