diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index 7ac6bb389..f5bad8a6c 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -1564,17 +1564,20 @@ static inline void __start_tx(struct uart_port *port)
if (up->dma && !up->dma->tx_dma(up))
return;
- if (!(up->ier & UART_IER_THRI)) {
+ if (1) {
up->ier |= UART_IER_THRI;
serial_port_out(port, UART_IER, up->ier);
- if (up->bugs & UART_BUG_TXEN) {
+ if (1) {
unsigned char lsr;
lsr = serial_in(up, UART_LSR);
up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
- if (lsr & UART_LSR_THRE)
- serial8250_tx_chars(up);
+ while(!(lsr & UART_LSR_THRE)) {
+ lsr = serial_in(up, UART_LSR);
+ }
+ serial8250_tx_chars(up);
+ // if (lsr & UART_LSR_THRE)
}
}
@@ -2376,7 +2379,7 @@ int serial8250_do_startup(struct uart_port *port)
} else {
up->bugs &= ~UART_BUG_TXEN;
}
-
+ up->bugs |= UART_BUG_TXEN;
dont_test_tx_en:
spin_unlock_irqrestore(&port->lock, flags);
Linux内核 - 8250 dw驱动 - 中断改poll
最新推荐文章于 2024-11-14 20:57:19 发布