twx-linux/drivers/tty/serial
Ryo Takakura 3b377f805e serial: sifive: lock port in startup()/shutdown() callbacks
commit e1ca3ff28ab1e2c1e70713ef3fa7943c725742c3 upstream.

startup()/shutdown() callbacks access SIFIVE_SERIAL_IE_OFFS.
The register is also accessed from write() callback.

If console were printing and startup()/shutdown() callback
gets called, its access to the register could be overwritten.

Add port->lock to startup()/shutdown() callbacks to make sure
their access to SIFIVE_SERIAL_IE_OFFS is synchronized against
write() callback.

Fixes: 45c054d0815b ("tty: serial: add driver for the SiFive UART")
Signed-off-by: Ryo Takakura <ryotkkr98@gmail.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: John Ogness <john.ogness@linutronix.de>
Rule: add
Link: https://lore.kernel.org/stable/20250330003522.386632-1-ryotkkr98%40gmail.com
Link: https://lore.kernel.org/r/20250412001847.183221-1-ryotkkr98@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-05-02 07:50:49 +02:00
..
8250 serial: 8250_dma: terminate correct DMA in tx_dma_flush() 2025-04-07 10:06:37 +02:00
jsm
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 serial: amba-pl011: fix build regression 2024-12-14 20:00:23 +01:00
apbuart.c serial: apbuart: fix console prompt on qemu 2024-01-25 15:35:55 -08: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: atmel_serial: use the correct RTS flag. 2024-08-29 17:33:10 +02:00
atmel_serial.h
bcm63xx_uart.c serial: bcm63xx-uart: fix tx after conversion to uart_port_tx_limited() 2024-07-05 09:34:00 +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
earlycon.c
fsl_linflexuart.c serial: linflexuart: Use devm_platform_get_and_ioremap_resource() 2023-07-25 20:25:52 +02:00
fsl_lpuart.c tty: serial: fsl_lpuart: disable transmitter before changing RS485 related registers 2025-04-07 10:06:37 +02:00
icom.c
imx_earlycon.c
imx.c serial: imx: Update mctrl old_status on RTSD interrupt 2024-10-22 15:46:33 +02:00
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 serial: kgdboc: Fix NMI-safety problems from keyboard reset code 2024-05-25 16:22:54 +02: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
ma35d1_serial.c tty: serial: ma35d1: Add a NULL check for of_node 2024-07-18 13:21:21 +02:00
Makefile serial: cpm_uart: Remove cpm_uart/ subdirectory 2023-08-04 15:08:30 +02:00
max310x.c serial: max310x: fix NULL pointer dereference in I2C instantiation 2024-04-03 15:28:16 +02:00
max3100.c serial: max3100: Fix bitwise types 2024-06-12 11:12:17 +02:00
mcf.c tty: mcf: MCF54418 has 10 UARTS 2024-07-05 09:34:00 +02:00
men_z135_uart.c
meson_uart.c tty: serial: meson: fix hard LOCKUP on crtscts mode 2023-11-28 17:19:57 +00: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: Configure correct working mode before starting earlycon 2025-05-02 07:50:49 +02:00
mux.c
mvebu-uart.c serial: mvebu-uart: Use devm_platform_get_and_ioremap_resource() 2023-07-25 20:26:07 +02:00
mxs-auart.c serial: mxs-auart: add spinlock around changing cts state 2024-04-27 17:11:39 +02:00
omap-serial.c serial: omap: do not override settings for RS485 support 2024-01-25 15:35:44 -08:00
owl-uart.c
pch_uart.c
pic32_uart.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
pmac_zilog.c serial/pmac_zilog: Remove flawed mitigation for rx irq flood 2024-04-27 17:11:39 +02: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 serial: qcom-geni: fix receiver enable 2024-10-22 15:46:35 +02:00
rda-uart.c
rp2.c tty: rp2: Fix reset with non forgiving PCIe host bridges 2024-10-04 16:29:51 +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: fix tx_empty() to return TIOCSER_TEMT 2024-03-26 18:20:05 -04:00
sb1250-duart.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
sc16is7xx.c serial: sc16is7xx: use device_property APIs when configuring irda mode 2025-02-08 09:51:50 +01:00
sccnxp.c serial: sccnxp: Use devm_platform_get_and_ioremap_resource() 2023-07-25 20:26:07 +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_base.h serial: core: Fix missing shutdown and startup for serial base port 2024-04-27 17:11:39 +02:00
serial_core.c serial: protect uart_port_dtr_rts() in uart_shutdown() too 2024-10-17 15:24:19 +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: port: Always update ->iotype in __uart_read_properties() 2025-02-21 13:57:18 +01:00
serial_txx9.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
serial-tegra.c serial: tegra: handle clk prepare error in tegra_uart_hw_init() 2023-08-22 15:29:18 +02:00
sh-sci.c serial: sh-sci: Do not probe the serial port if its slot in sci_ports[] is in use 2025-02-17 09:40:24 +01:00
sh-sci.h
sifive.c serial: sifive: lock port in startup()/shutdown() callbacks 2025-05-02 07:50:49 +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: Reset .throttled state in .startup() 2024-04-27 17:11:39 +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
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: xilinx_uartps: split sysrq handling 2025-02-17 09:40:43 +01:00
zs.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
zs.h