mirror of
https://github.com/opnsense/src.git
synced 2026-06-15 11:39:33 -04:00
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. MFC after: 2 weeks
This commit is contained in:
parent
964b0ece79
commit
0d2fd5b99c
1 changed files with 2 additions and 2 deletions
|
|
@ -265,12 +265,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("uart: ns8250: UART FCR is broken\n");
|
||||
printf("uart: ns8250: UART FCR is broken (%#x)\n", drain);
|
||||
ns8250_drain(bas, drain);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue