freebsd-src/sys/arm/nvidia
Marius Strobl 353e4c5a06 uart(4): Honor hardware state of NS8250-class for tsw_busy
In 9750d9e5, I brought the equivalent of the TS_BUSY flag back in a
mostly hardware-agnostic way in order to fix tty_drain() and, thus,
TIOCDRAIN for UARTs with TX FIFOs. This proved to be sufficient for
fixing the regression reported. So in light of the release cycle of
FreeBSD 10.3, I decided that this change was be good enough for the
time being and opted to go with the smallest possible yet generic
(for all UARTs driven by uart(4)) solution addressing the problem at
hand.

However, at least for the NS8250-class the above isn't a complete
fix as these UARTs only trigger an interrupt when the TX FIFO became
empty. At this point, there still can be an outstanding character
left in the transmit shift register as indicated via the LSR. Thus,
this change adds the 3rd (besides the tty(4) and generic uart(4) bits)
part I had in my tree ever since, adding a uart_txbusy method to be
queried in addition for tsw_busy and hooking it up as appropriate
for the NS8250-class.

As it turns out, the exact equivalent of this 3rd part later on was
implemented for uftdi(4) in 9ad221a5.

While at it, explain the rational behind the deliberately missing
locking in uart_tty_busy() (also applying to the generic sc_txbusy
testing already present).
2024-01-14 08:03:59 +01:00
..
drm2 regulator: Move regulator code in dev/regulator 2024-01-10 19:20:32 +01:00
tegra124 phy: Move phy code in dev/phy 2024-01-10 19:20:34 +01:00
as3722.c regulator: Move regulator code in dev/regulator 2024-01-10 19:20:32 +01:00
as3722.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
as3722_gpio.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
as3722_regulators.c regulator: Move regulator code in dev/regulator 2024-01-10 19:20:32 +01:00
as3722_rtc.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
tegra_abpmisc.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
tegra_ahci.c phy: Move phy code in dev/phy 2024-01-10 19:20:34 +01:00
tegra_efuse.c hwreset: Move reset code in dev/hwreset 2024-01-10 19:20:28 +01:00
tegra_efuse.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
tegra_ehci.c phy: Move phy code in dev/phy 2024-01-10 19:20:34 +01:00
tegra_gpio.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
tegra_i2c.c hwreset: Move reset code in dev/hwreset 2024-01-10 19:20:28 +01:00
tegra_lic.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
tegra_mc.c clk: Move clock code in dev/clk 2024-01-10 19:20:26 +01:00
tegra_pcie.c phy: Move phy code in dev/phy 2024-01-10 19:20:34 +01:00
tegra_pinmux.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
tegra_pmc.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
tegra_rtc.c clk: Move clock code in dev/clk 2024-01-10 19:20:26 +01:00
tegra_sdhci.c hwreset: Move reset code in dev/hwreset 2024-01-10 19:20:28 +01:00
tegra_soctherm.c hwreset: Move reset code in dev/hwreset 2024-01-10 19:20:28 +01:00
tegra_soctherm_if.m sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
tegra_uart.c uart(4): Honor hardware state of NS8250-class for tsw_busy 2024-01-14 08:03:59 +01:00
tegra_usbphy.c phy: Move phy code in dev/phy 2024-01-10 19:20:34 +01:00
tegra_xhci.c phy: Move phy code in dev/phy 2024-01-10 19:20:34 +01:00