The branch stable/14 has been updated by avg:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=ec88c48413850768692a92736229e85b5d262935

commit ec88c48413850768692a92736229e85b5d262935
Author:     Andriy Gapon <a...@freebsd.org>
AuthorDate: 2024-11-10 11:15:30 +0000
Commit:     Andriy Gapon <a...@freebsd.org>
CommitDate: 2025-06-27 07:37:55 +0000

    ns8250: use LSR_THRE instead of LSR_TEMT for checking tx flush
    
    LSR_TEMT bit is set if both transmit hold and shift registers are
    empty, but the flush command flushes only the hold register.
    
    While here, update the diagnostic message to report which registers
    could not be flushed.
    
    (cherry picked from commit 0d2fd5b99c95329085d0700a4dd38507a054a50d)
---
 sys/dev/uart/uart_dev_ns8250.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c
index ced3b44b5749..b73838b7d2b2 100644
--- a/sys/dev/uart/uart_dev_ns8250.c
+++ b/sys/dev/uart/uart_dev_ns8250.c
@@ -230,12 +230,12 @@ ns8250_flush(struct uart_bas *bas, int what)
         * https://github.com/rust-vmm/vm-superio/issues/83
         */
        lsr = uart_getreg(bas, REG_LSR);
-       if (((lsr & LSR_TEMT) == 0) && (what & UART_FLUSH_TRANSMITTER))
+       if (((lsr & LSR_THRE) == 0) && (what & UART_FLUSH_TRANSMITTER))
                drain |= UART_DRAIN_TRANSMITTER;
        if ((lsr & LSR_RXRDY) && (what & UART_FLUSH_RECEIVER))
                drain |= UART_DRAIN_RECEIVER;
        if (drain != 0) {
-               printf("ns8250: UART FCR is broken\n");
+               printf("ns8250: UART FCR is broken (%#x)\n", drain);
                ns8250_drain(bas, drain);
        }
 }

Reply via email to