Skip to content

Commit 7be50f2

Browse files
Jiri Slaby (SUSE)gregkh
authored andcommitted
serial: mxs-auart: fix tx
Emil reports: After updating Linux on an i.MX28 board, serial communication over AUART broke. When I TX from the board and measure on the TX pin, it seems like the HW fifo is not emptied before the transmission is stopped. MXS performs weird things with stop_tx(). The driver makes it conditional on uart_tx_stopped(). So the driver needs special handling. Pass the brand new UART_TX_NOSTOP to uart_port_tx_flags() and handle the stop on its own. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Reported-by: Emil Kronborg <emil.kronborg@protonmail.com> Cc: stable <stable@kernel.org> Fixes: 2d141e6 ("tty: serial: use uart_port_tx() helper") Closes: https://lore.kernel.org/all/miwgbnvy3hjpnricubg76ytpn7xoceehwahupy25bubbduu23s@om2lptpa26xw/ Tested-by: Stefan Wahren <wahrenst@gmx.net> Tested-by: Emil Kronborg <emil.kronborg@protonmail.com> Link: https://lore.kernel.org/r/20240201105557.28043-2-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3ee0796 commit 7be50f2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/tty/serial/mxs-auart.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,13 +605,16 @@ static void mxs_auart_tx_chars(struct mxs_auart_port *s)
605605
return;
606606
}
607607

608-
pending = uart_port_tx(&s->port, ch,
608+
pending = uart_port_tx_flags(&s->port, ch, UART_TX_NOSTOP,
609609
!(mxs_read(s, REG_STAT) & AUART_STAT_TXFF),
610610
mxs_write(ch, s, REG_DATA));
611611
if (pending)
612612
mxs_set(AUART_INTR_TXIEN, s, REG_INTR);
613613
else
614614
mxs_clr(AUART_INTR_TXIEN, s, REG_INTR);
615+
616+
if (uart_tx_stopped(&s->port))
617+
mxs_auart_stop_tx(&s->port);
615618
}
616619

617620
static void mxs_auart_rx_char(struct mxs_auart_port *s)

0 commit comments

Comments
 (0)