serial: mvebu-uart: fix driver's tx_empty callback
Pali Rohár
maintainerPATCH 1/1 serial: mvebu-uart: fix driver's tx_empty callback
Driver's tx_empty callback should signal when the transmit shift register is empty. So when the last character has been sent.
STAT_TX_FIFO_EMP bit signals only that HW transmit FIFO is empty, which happens when the last byte is loaded into transmit shift register.
STAT_TX_EMP bit signals when the both HW transmit FIFO and transmit shift register are empty.
So replace STAT_TX_FIFO_EMP check by STAT_TX_EMP in mvebu_uart_tx_empty() callback function.
Signed-off-by Pali Rohár <[email protected]>
Fixes 30530791a7a0 ("serial: mvebu-uart: initial support for Armada-3700 serial port")
--- drivers/tty/serial/mvebu-uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/mvebu-uart.c +1 -1
@@ -191,7 +191,7 @@ static unsigned int mvebu_uart_tx_empty(struct uart_port *port) st =readl (port->membase +UART_STAT );spin_unlock_irqrestore (&port->lock, flags); -return (st &STAT_TX_FIFO_EMP ) ?TIOCSER_TEMT :0 ; +return (st &STAT_TX_EMP ) ?TIOCSER_TEMT :0 ; }static unsigned int mvebu_uart_get_mctrl (struct uart_port *port)
Signature · 1 line
2.20.1