opnsense-src/sys/dev/uart
Mitchell Horne 7e7f7beee7 ns8250: don't drop IER_TXRDY on bus_grab/ungrab
It has been observed that some systems are often unable to resume from
ddb after entering with debug.kdb.enter=1. Checking the status further
shows the terminal is blocked waiting in tty_drain(), but it never makes
progress in clearing the output queue, because sc->sc_txbusy is high.

I noticed that when entering polling mode for the debugger, IER_TXRDY is
set in the failure case. Since this bit is never tracked by the softc,
it will not be restored by ns8250_bus_ungrab(). This creates a race in
which a TX interrupt can be lost, creating the hang described above.
Ensuring that this bit is restored is enough to prevent this, and resume
from ddb as expected.

The solution is to track this bit in the sc->ier field, for the same
lifetime that TX interrupts are enabled.

PR:		223917, 240122
Reviewed by:	imp, manu
Tested by:	bz
MFC after:	5 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29130
2021-03-10 11:04:42 -04:00
..
uart.h scc(4)/uart(4): Remove obsolete support for Siemens SAB 82532 2020-12-26 13:48:06 +01:00
uart_bus.h Export a sysctl count of RX FIFO overrun events. 2020-04-13 20:59:09 +00:00
uart_bus_acpi.c uart: clean up empty lines in .c and .h files 2020-09-01 21:50:00 +00:00
uart_bus_fdt.c uart: allow UART_DEV_DBGPORT for fdt consoles 2020-12-02 21:01:52 +00:00
uart_bus_isa.c Regularize my copyright notice 2019-12-04 16:56:11 +00:00
uart_bus_pci.c uart: only use MSI on devices that advertise 1 MSI vector 2021-02-17 15:08:19 -07:00
uart_bus_puc.c Regularize my copyright notice 2019-12-04 16:56:11 +00:00
uart_bus_scc.c scc(4)/uart(4): Remove obsolete support for Siemens SAB 82532 2020-12-26 13:48:06 +01:00
uart_core.c Export a sysctl count of RX FIFO overrun events. 2020-04-13 20:59:09 +00:00
uart_cpu.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
uart_cpu_acpi.c Fix AccessWidth and BitWidth parsing in SPCR table 2020-06-24 12:15:27 +00:00
uart_cpu_acpi.h Use ACPI SPCR on x86 2019-05-23 19:55:53 +00:00
uart_cpu_arm64.c uart: allow UART_DEV_DBGPORT for fdt consoles 2020-12-02 21:01:52 +00:00
uart_cpu_fdt.c uart: allow UART_DEV_DBGPORT for fdt consoles 2020-12-02 21:01:52 +00:00
uart_cpu_fdt.h uart: allow UART_DEV_DBGPORT for fdt consoles 2020-12-02 21:01:52 +00:00
uart_cpu_powerpc.c uart: clean up empty lines in .c and .h files 2020-09-01 21:50:00 +00:00
uart_cpu_x86.c Use ACPI SPCR on x86 2019-05-23 19:55:53 +00:00
uart_dbg.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
uart_dev_imx.c Add i.MX 8M Quad support 2020-07-01 00:33:16 +00:00
uart_dev_imx.h uart: clean up empty lines in .c and .h files 2020-09-01 21:50:00 +00:00
uart_dev_lowrisc.c Add support for the UART device found in lowRISC system-on-a-chip. 2018-10-12 15:19:41 +00:00
uart_dev_lowrisc.h Add support for the UART device found in lowRISC system-on-a-chip. 2018-10-12 15:19:41 +00:00
uart_dev_msm.c Support for UART device found in Qualcomm Snapdragon 410E SoC. 2018-01-18 17:43:32 +00:00
uart_dev_msm.h UART Clock Selection Register holds a divider value for a supplied clock, 2018-01-18 18:19:31 +00:00
uart_dev_mu.c uart: clean up empty lines in .c and .h files 2020-09-01 21:50:00 +00:00
uart_dev_mvebu.c uart: clean up empty lines in .c and .h files 2020-09-01 21:50:00 +00:00
uart_dev_ns8250.c ns8250: don't drop IER_TXRDY on bus_grab/ungrab 2021-03-10 11:04:42 -04:00
uart_dev_ns8250.h uart: clean up empty lines in .c and .h files 2020-09-01 21:50:00 +00:00
uart_dev_pl011.c uart: clean up empty lines in .c and .h files 2020-09-01 21:50:00 +00:00
uart_dev_quicc.c uart: clean up empty lines in .c and .h files 2020-09-01 21:50:00 +00:00
uart_dev_snps.c Remove "all rights reserved" from copyright for the file that Jared McNeill 2019-12-03 21:05:33 +00:00
uart_dev_ti8250.c Move Ti AM335x to dev/extres/clk framework. 2020-07-30 14:45:05 +00:00
uart_dev_z8530.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
uart_if.m
uart_ppstypes.h
uart_subr.c uart: Improve console specification parsing 2021-01-14 17:47:04 -07:00
uart_tty.c Some devices take undesired actions when RTS and DTR are 2019-06-12 18:07:04 +00:00