linux/drivers/tty/serial
Thomas Gleixner 35e0a33952 serial: sunsab: Use port lock wrappers
When a serial port is used for kernel console output, then all
modifications to the UART registers which are done from other contexts,
e.g. getty, termios, are interference points for the kernel console.

So far this has been ignored and the printk output is based on the
principle of hope. The rework of the console infrastructure which aims to
support threaded and atomic consoles, requires to mark sections which
modify the UART registers as unsafe. This allows the atomic write function
to make informed decisions and eventually to restore operational state. It
also allows to prevent the regular UART code from modifying UART registers
while printk output is in progress.

All modifications of UART registers are guarded by the UART port lock,
which provides an obvious synchronization point with the console
infrastructure.

To avoid adding this functionality to all UART drivers, wrap the
spin_[un]lock*() invocations for uart_port::lock into helper functions
which just contain the spin_[un]lock*() invocations for now. In a
subsequent step these helpers will gain the console synchronization
mechanisms.

Converted with coccinelle. No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Link: https://lore.kernel.org/r/20230914183831.587273-68-john.ogness@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-09-18 11:18:15 +02:00
..
8250 serial: 8250_pci1xxxx: Use port lock wrappers 2023-09-18 11:18:09 +02:00
jsm serial: jsm: Use port lock wrappers 2023-09-18 11:18:11 +02:00
21285.c serial: 21285: Use port lock wrappers 2023-09-18 11:18:08 +02:00
altera_jtaguart.c serial: altera_jtaguart: Use port lock wrappers 2023-09-18 11:18:09 +02:00
altera_uart.c serial: altera_uart: Use port lock wrappers 2023-09-18 11:18:09 +02:00
amba-pl010.c serial: amba-pl010: Use port lock wrappers 2023-09-18 11:18:09 +02:00
amba-pl011.c serial: amba-pl011: Use port lock wrappers 2023-09-18 11:18:10 +02:00
apbuart.c serial: apb: Use port lock wrappers 2023-09-18 11:18:10 +02:00
apbuart.h
ar933x_uart.c serial: ar933x: Use port lock wrappers 2023-09-18 11:18:10 +02:00
arc_uart.c serial: arc_uart: Use port lock wrappers 2023-09-18 11:18:10 +02:00
atmel_serial.c serial: atmel: Use port lock wrappers 2023-09-18 11:18:10 +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 port lock wrappers 2023-09-18 11:18:10 +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: Use port lock wrappers 2023-09-18 11:18:10 +02:00
cpm_uart.h serial: cpm_uart: Remove cpm_uart/ subdirectory 2023-08-04 15:08:30 +02:00
digicolor-usart.c serial: digicolor: Use port lock wrappers 2023-09-18 11:18:10 +02:00
dz.c serial: dz: Use port lock wrappers 2023-09-18 11:18:11 +02:00
dz.h
earlycon-riscv-sbi.c serial: make uart_console_write->putchar()'s character an unsigned char 2022-03-03 15:06:31 +01:00
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 port lock wrappers 2023-09-18 11:18:11 +02:00
fsl_lpuart.c serial: fsl_lpuart: Use port lock wrappers 2023-09-18 11:18:11 +02:00
icom.c serial: icom: Use port lock wrappers 2023-09-18 11:18:11 +02:00
imx_earlycon.c serial: make uart_console_write->putchar()'s character an unsigned char 2022-03-03 15:06:31 +01:00
imx.c serial: imx: Use port lock wrappers 2023-09-18 11:18:11 +02:00
ip22zilog.c serial: ip22zilog: Use port lock wrappers 2023-09-18 11:18:11 +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 serial: liteuart: Use port lock wrappers 2023-09-18 11:18:11 +02:00
lpc32xx_hs.c serial: lpc32xx_hs: Use port lock wrappers 2023-09-18 11:18:11 +02:00
ma35d1_serial.c serial: ma35d1: Use port lock wrappers 2023-09-18 11:18:12 +02:00
Makefile tty/serial: Sort drivers in makefile 2023-09-18 11:14:43 +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: mcf: Use port lock wrappers 2023-09-18 11:18:12 +02:00
men_z135_uart.c serial: men_z135_uart: Use port lock wrappers 2023-09-18 11:18:12 +02:00
meson_uart.c serial: meson: Use port lock wrappers 2023-09-18 11:18:12 +02:00
milbeaut_usio.c serial: milbeaut_usio: Use port lock wrappers 2023-09-18 11:18:12 +02:00
mpc52xx_uart.c serial: mpc52xx: Use port lock wrappers 2023-09-18 11:18:12 +02:00
mps2-uart.c serial: mps2-uart: Use port lock wrappers 2023-09-18 11:18:12 +02:00
msm_serial.c serial: msm: Use port lock wrappers 2023-09-18 11:18:12 +02: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 port lock wrappers 2023-09-18 11:18:12 +02:00
mxs-auart.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
omap-serial.c serial: omap: Use port lock wrappers 2023-09-18 11:18:13 +02:00
owl-uart.c serial: owl: Use port lock wrappers 2023-09-18 11:18:13 +02:00
pch_uart.c serial: pch: Use port lock wrappers 2023-09-18 11:18:13 +02:00
pic32_uart.c serial: pic32: Use port lock wrappers 2023-09-18 11:18:13 +02:00
pmac_zilog.c serial: pmac_zilog: Use port lock wrappers 2023-09-18 11:18:13 +02:00
pmac_zilog.h serial: pmac_zilog: remove unused uart_pmac_port::termios_cache 2022-05-19 18:23:19 +02:00
pxa.c serial: pxa: Use port lock wrappers 2023-09-18 11:18:13 +02:00
qcom_geni_serial.c serial: qcom-geni: Use port lock wrappers 2023-09-18 11:18:13 +02:00
rda-uart.c serial: rda: Use port lock wrappers 2023-09-18 11:18:13 +02:00
rp2.c serial: rp2: Use port lock wrappers 2023-09-18 11:18:14 +02:00
sa1100.c serial: sa1100: Use port lock wrappers 2023-09-18 11:18:14 +02:00
samsung_tty.c serial: samsung_tty: Use port lock wrappers 2023-09-18 11:18:14 +02:00
sb1250-duart.c serial: sb1250-duart: Use port lock wrappers 2023-09-18 11:18:14 +02:00
sc16is7xx.c serial: sc16is7xx: Use port lock wrappers 2023-09-18 11:18:14 +02: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 serial core port id, including multiport devices 2023-08-11 21:19:22 +02:00
serial_core.c serial: core: Use port lock wrappers 2023-09-18 11:18:14 +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: Use port lock wrappers 2023-09-18 11:18:14 +02:00
serial_mctrl_gpio.h
serial_port.c serial: core: Use port lock wrappers 2023-09-18 11:18:14 +02:00
serial_txx9.c serial: txx9: Use port lock wrappers 2023-09-18 11:18:14 +02:00
serial-tegra.c serial: tegra: Use port lock wrappers 2023-09-18 11:18:14 +02:00
sh-sci.c serial: sh-sci: Use port lock wrappers 2023-09-18 11:18:15 +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: Use port lock wrappers 2023-09-18 11:18:15 +02:00
sprd_serial.c serial: sprd: Use port lock wrappers 2023-09-18 11:18:15 +02:00
st-asc.c serial: st-asc: Use port lock wrappers 2023-09-18 11:18:15 +02:00
stm32-usart.c serial: stm32: Use port lock wrappers 2023-09-18 11:18:15 +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 serial: sunhv: Use port lock wrappers 2023-09-18 11:18:15 +02:00
sunplus-uart.c serial: sunplus-uart: Use port lock wrappers 2023-09-18 11:18:15 +02:00
sunsab.c serial: sunsab: Use port lock wrappers 2023-09-18 11:18:15 +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