• Andy Shevchenko's avatar
    serial: 8250_port: fix runtime PM use in __do_stop_tx_rs485() · ddd80608
    Andy Shevchenko authored
    commit b3965767d86cf4534dfe1affbde0453d3224ed7f upstream.
    
    There are calls to serial8250_rpm_{get|put}() in __do_stop_tx_rs485() that are
    certainly placed in a wrong location. I dunno how it had been tested with
    runtime PM enabled because it is obvious "sleep in atomic context" error.
    
    Besides that serial8250_rpm_get() is called immediately after an IO just
    happened. It implies that the device is already powered on, see implementation
    of serial8250_em485_rts_after_send() and serial8250_clear_fifos() for the
    details.
    
    There is no bug have been seen due to, as I can guess, use of auto suspend mode
    when scheduled transaction to suspend is invoked quite lately than it's needed
    for a few writes to the port. It might be possible to trigger a warning if
    stop_tx_timer fires when device is suspended.
    
    Refactor the code to use runtime PM only in case of timer function.
    
    Fixes: 0c66940d ("tty/serial/8250: fix RS485 half-duplex RX")
    Cc: "Matwey V. Kornilov" <matwey@sai.msu.ru>
    Tested-by: default avatarYegor Yefremov <yegorslists@googlemail.com>
    Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    ddd80608
Name
Last commit
Last update
..
8250 Loading commit data...
cpm_uart Loading commit data...
jsm Loading commit data...
21285.c Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
altera_jtaguart.c Loading commit data...
altera_uart.c Loading commit data...
amba-pl010.c Loading commit data...
amba-pl011.c Loading commit data...
amba-pl011.h Loading commit data...
apbuart.c Loading commit data...
apbuart.h Loading commit data...
ar933x_uart.c Loading commit data...
arc_uart.c Loading commit data...
atmel_serial.c Loading commit data...
bcm63xx_uart.c Loading commit data...
bfin_sport_uart.c Loading commit data...
bfin_sport_uart.h Loading commit data...
bfin_uart.c Loading commit data...
clps711x.c Loading commit data...
crisv10.c Loading commit data...
crisv10.h Loading commit data...
digicolor-usart.c Loading commit data...
dz.c Loading commit data...
dz.h Loading commit data...
earlycon-arm-semihost.c Loading commit data...
earlycon.c Loading commit data...
efm32-uart.c Loading commit data...
etraxfs-uart.c Loading commit data...
fsl_lpuart.c Loading commit data...
icom.c Loading commit data...
icom.h Loading commit data...
ifx6x60.c Loading commit data...
ifx6x60.h Loading commit data...
imx.c Loading commit data...
ioc3_serial.c Loading commit data...
ioc4_serial.c Loading commit data...
ip22zilog.c Loading commit data...
ip22zilog.h Loading commit data...
kgdb_nmi.c Loading commit data...
kgdboc.c Loading commit data...
lantiq.c Loading commit data...
lpc32xx_hs.c Loading commit data...
m32r_sio.c Loading commit data...
m32r_sio_reg.h Loading commit data...
max3100.c Loading commit data...
max310x.c Loading commit data...
mcf.c Loading commit data...
men_z135_uart.c Loading commit data...
meson_uart.c Loading commit data...
mpc52xx_uart.c Loading commit data...
mps2-uart.c Loading commit data...
mpsc.c Loading commit data...
msm_serial.c Loading commit data...
mux.c Loading commit data...
mvebu-uart.c Loading commit data...
mxs-auart.c Loading commit data...
netx-serial.c Loading commit data...
omap-serial.c Loading commit data...
pch_uart.c Loading commit data...
pic32_uart.c Loading commit data...
pic32_uart.h Loading commit data...
pmac_zilog.c Loading commit data...
pmac_zilog.h Loading commit data...
pnx8xxx_uart.c Loading commit data...
pxa.c Loading commit data...
rp2.c Loading commit data...
sa1100.c Loading commit data...
samsung.c Loading commit data...
samsung.h Loading commit data...
sb1250-duart.c Loading commit data...
sc16is7xx.c Loading commit data...
sccnxp.c Loading commit data...
serial-tegra.c Loading commit data...
serial_core.c Loading commit data...
serial_ks8695.c Loading commit data...
serial_mctrl_gpio.c Loading commit data...
serial_mctrl_gpio.h Loading commit data...
serial_txx9.c Loading commit data...
sh-sci.c Loading commit data...
sh-sci.h Loading commit data...
sirfsoc_uart.c Loading commit data...
sirfsoc_uart.h Loading commit data...
sn_console.c Loading commit data...
sprd_serial.c Loading commit data...
st-asc.c Loading commit data...
stm32-usart.c Loading commit data...
suncore.c Loading commit data...
sunhv.c Loading commit data...
sunsab.c Loading commit data...
sunsab.h Loading commit data...
sunsu.c Loading commit data...
sunzilog.c Loading commit data...
sunzilog.h Loading commit data...
tilegx.c Loading commit data...
timbuart.c Loading commit data...
timbuart.h Loading commit data...
uartlite.c Loading commit data...
ucc_uart.c Loading commit data...
vr41xx_siu.c Loading commit data...
vt8500_serial.c Loading commit data...
xilinx_uartps.c Loading commit data...
zs.c Loading commit data...
zs.h Loading commit data...