linux-stable/drivers/tty/serial
Daniel Thompson b2aba15ad6 serial: kgdboc: Fix NMI-safety problems from keyboard reset code
Currently, when kdb is compiled with keyboard support, then we will use
schedule_work() to provoke reset of the keyboard status.  Unfortunately
schedule_work() gets called from the kgdboc post-debug-exception
handler.  That risks deadlock since schedule_work() is not NMI-safe and,
even on platforms where the NMI is not directly used for debugging, the
debug trap can have NMI-like behaviour depending on where breakpoints
are placed.

Fix this by using the irq work system, which is NMI-safe, to defer the
call to schedule_work() to a point when it is safe to call.

Reported-by: Liuye <liu.yeC@h3c.com>
Closes: https://lore.kernel.org/all/20240228025602.3087748-1-liu.yeC@h3c.com/
Cc: stable@vger.kernel.org
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240424-kgdboc_fix_schedule_work-v2-1-50f5a490aec5@linaro.org
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
2024-04-26 17:14:10 +01:00
..
8250 TTY/Serial driver update for 6.9-rc1 2024-03-21 12:44:10 -07:00
jsm tty: jsm: Remove redundant assignment to variable linestatus 2024-02-18 18:59:58 +01:00
21285.c serial: 21285: Use port lock wrappers 2023-09-18 11:18:08 +02:00
altera_jtaguart.c serial: altera_jtaguart: Convert to platform remove callback returning void 2023-11-23 19:12:30 +00:00
altera_uart.c tty/serial: altera_uart: use more informative labels in /proc/interrupts 2024-01-04 16:20:51 +01: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 uart_prepare_sysrq_char(). 2024-03-02 22:06:20 +01:00
apbuart.c serial: apbuart: fix console prompt on qemu 2024-01-04 16:21:06 +01:00
apbuart.h
ar933x_uart.c serial: ar933x: Use uart_prepare_sysrq_char(). 2024-03-02 22:06:20 +01:00
arc_uart.c serial: arc_uart: Use port lock wrappers 2023-09-18 11:18:10 +02:00
atmel_serial.c serial: atmel: convert not to use dma_request_slave_channel() 2023-11-23 19:32:36 +00: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: Use uart_prepare_sysrq_char(). 2024-03-02 22:06:20 +01:00
clps711x.c serial: clps711x: Convert to platform remove callback returning void 2023-11-23 19:12:31 +00:00
cpm_uart.c serial: cpm: Convert to platform remove callback returning void 2023-11-23 19:12:31 +00:00
cpm_uart.h serial: cpm_uart: Remove cpm_uart/ subdirectory 2023-08-04 15:08:30 +02:00
digicolor-usart.c serial: digicolor: Convert to platform remove callback returning void 2023-11-23 19:12:31 +00:00
dz.c serial: dz: Use port lock wrappers 2023-09-18 11:18:11 +02:00
dz.h
earlycon-riscv-sbi.c tty/serial: Add RISC-V SBI debug console based earlycon 2024-01-10 07:04:04 -08: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
esp32_acm.c serial: esp32_acm: Add explicit platform_device.h include 2023-12-15 14:20:00 +01:00
esp32_uart.c serial: esp32_uart: Use device_get_match_data() 2023-12-15 14:20:00 +01:00
fsl_linflexuart.c serial: linflexuart: Remove redundant uart type assignment 2024-01-27 18:40:17 -08:00
fsl_lpuart.c tty: serial: fsl_lpuart: avoid idle preamble pending if CTS is enabled 2024-03-05 13:40:07 +00: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 tty: serial: imx: Fix broken RS485 2024-03-02 22:10:35 +01:00
ip22zilog.c serial: ip22zilog: Use port lock wrappers 2023-09-18 11:18:11 +02:00
ip22zilog.h
Kconfig RISC-V Patches for the 6.8 Merge Window, Part 4 2024-01-20 11:06:04 -08: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-04-26 17:14:10 +01:00
lantiq.c serial: lantiq: Convert to platform remove callback returning void 2023-11-23 19:12:32 +00:00
liteuart.c serial: liteuart: Convert to platform remove callback returning void 2023-11-23 19:12:32 +00:00
lpc32xx_hs.c serial: lpc32xx_hs: Use uart_prepare_sysrq_char() to handle sysrq. 2024-03-02 22:06:21 +01:00
ma35d1_serial.c serial: ma35d1: Fix spelling mistake "ononsole" -> "console" 2023-12-15 14:23:30 +01:00
Makefile drivers/tty/serial: add ESP32S3 ACM gadget driver 2023-10-16 20:18:15 +02:00
max310x.c Merge 6.8-rc3 into tty-next 2024-02-04 06:21:02 -08:00
max3100.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
mcf.c drivers/tty/serial: Remove unused function early_mcf_setup 2024-03-02 21:52:35 +01: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 uart_prepare_sysrq_char(). 2024-03-02 22:06:21 +01:00
milbeaut_usio.c serial: milbeaut_usio: Convert to platform remove callback returning void 2023-11-23 19:12:32 +00:00
mpc52xx_uart.c serial: mpc52xx: Convert to platform remove callback returning void 2023-11-23 19:12:32 +00: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 uart_prepare_sysrq_char(). 2024-03-02 22:06:21 +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 port lock wrappers 2023-09-18 11:18:12 +02:00
mxs-auart.c serial: mxs-auart: fix tx 2024-02-06 14:42:11 +00:00
omap-serial.c serial: omap: Use uart_prepare_sysrq_char(). 2024-03-02 22:06:21 +01:00
owl-uart.c serial: owl: Use uart_prepare_sysrq_char() to handle sysrq. 2024-03-02 22:06:21 +01:00
pch_uart.c serial: pch: Use uart_prepare_sysrq_char(). 2024-03-02 22:06:22 +01:00
pic32_uart.c serial: pic32: Convert to platform remove callback returning void 2023-11-23 19:12:33 +00:00
pmac_zilog.c TTY/Serial driver update for 6.9-rc1 2024-03-21 12:44:10 -07: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 uart_prepare_sysrq_char(). 2024-03-02 22:06:21 +01:00
qcom_geni_serial.c TTY/Serial driver update for 6.9-rc1 2024-03-21 12:44:10 -07:00
rda-uart.c serial: rda: Use uart_prepare_sysrq_char() to handle sysrq. 2024-03-02 22:06:21 +01:00
rp2.c tty: rp2: remove unused rp2_uart_port::ignore_rx 2023-11-23 19:16:03 +00:00
sa1100.c serial: sa1100: Convert to platform remove callback returning void 2023-11-23 19:12:33 +00:00
samsung_tty.c serial: samsung: honor fifosize from dts at first 2024-03-02 22:04:05 +01:00
sb1250-duart.c serial: sb1250-duart: Use port lock wrappers 2023-09-18 11:18:14 +02:00
sc16is7xx.c serial: sc16is7xx: refactor EFR lock 2024-01-04 16:30:05 +01:00
sccnxp.c serial: sccnxp: Convert to platform remove callback returning void 2023-11-23 19:12:34 +00:00
serial_base_bus.c serial: core: make serial_base_bus_type const 2024-02-06 14:35:42 +00: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: Lock console when calling into driver before registration 2024-03-05 13:39:11 +00: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: mctrl_gpio: add a new API to enable / disable wake_irq 2022-02-08 11:07:16 +01:00
serial_port.c TTY/Serial driver update for 6.9-rc1 2024-03-21 12:44:10 -07:00
serial_txx9.c serial: txx9: Add missing #include <asm/txx9/generic.h> 2024-01-27 19:05:39 -08:00
serial-tegra.c serial: tegra: Convert to platform remove callback returning void 2023-11-23 19:12:34 +00:00
sh-sci.c serial: sh-sci: Call sci_serial_{in,out}() directly 2024-03-05 13:37:32 +00: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 uart_prepare_sysrq_char() to handle sysrq. 2024-03-02 22:06:21 +01:00
sprd_serial.c serial: sprd: Convert to platform remove callback returning void 2023-11-23 19:12:34 +00:00
st-asc.c serial: st-asc: don't get/put GPIOs in atomic context 2024-03-02 22:04:12 +01:00
stm32-usart.c Merge 6.8-rc6 into tty-next 2024-02-27 06:22:13 +01:00
stm32-usart.h serial: stm32: get FIFO size from hwcfg register 2024-01-27 19:04:11 -08:00
suncore.c
sunhv.c serial: sunhv: Convert to platform remove callback returning void 2023-11-23 19:12:35 +00:00
sunplus-uart.c serial: sunplus: Use uart_prepare_sysrq_char(). 2024-03-02 22:06:21 +01:00
sunsab.c serial: sunsab: remove trailing whitespaces 2023-11-23 19:31:25 +00:00
sunsab.h
sunsu.c serial: sunsu: Convert to platform remove callback returning void 2023-11-23 19:12:35 +00:00
sunzilog.c serial: sunzilog: Convert to platform remove callback returning void 2023-11-23 19:12:35 +00:00
sunzilog.h
tegra-tcu.c serial: tegra-tcu: Convert to platform remove callback returning void 2023-11-23 19:12:35 +00:00
timbuart.c serial: timbuart: Convert to platform remove callback returning void 2023-11-23 19:12:35 +00:00
timbuart.h tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
uartlite.c serial: uartlite: Use dynamic allocation for major number when uart ports > 4 2023-11-25 07:23:16 +00:00
ucc_uart.c serial: ucc_uart: Fix multiple address space type errors 2023-12-08 12:02:37 +01:00
vt8500_serial.c serial: vt8500: Use port lock wrappers 2023-09-18 11:18:16 +02:00
xilinx_uartps.c tty: serial: uartps: Add rs485 support to uartps driver 2024-01-27 19:07:08 -08:00
zs.c serial: drivers: switch ch and flag to u8 2023-07-25 19:21:04 +02:00
zs.h