Skip to content

Commit e5928dc

Browse files
KanjiMonstersmb49
authored andcommitted
serial: bcm63xx-uart: fix tx after conversion to uart_port_tx_limited()
BugLink: https://bugs.launchpad.net/bugs/2076435 commit ea55c65 upstream. When bcm63xx-uart was converted to uart_port_tx_limited(), it implicitly added a call to stop_tx(). This causes garbage to be put out on the serial console. To fix this, pass UART_TX_NOSTOP in flags, and manually call stop_tx() ourselves analogue to how a similar issue was fixed in commit 7be50f2 ("serial: mxs-auart: fix tx"). Fixes: d11cc8c ("tty: serial: use uart_port_tx_limited()") Cc: stable@vger.kernel.org Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Signed-off-by: Doug Brown <doug@schmorgal.com> Link: https://lore.kernel.org/r/20240606195632.173255-4-doug@schmorgal.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Portia Stephens <portia.stephens@canonical.com> Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
1 parent 2f2af21 commit e5928dc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/tty/serial/bcm63xx_uart.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ static void bcm_uart_do_tx(struct uart_port *port)
309309

310310
val = bcm_uart_readl(port, UART_MCTL_REG);
311311
val = (val & UART_MCTL_TXFIFOFILL_MASK) >> UART_MCTL_TXFIFOFILL_SHIFT;
312-
313-
pending = uart_port_tx_limited(port, ch, port->fifosize - val,
312+
pending = uart_port_tx_limited_flags(port, ch, UART_TX_NOSTOP,
313+
port->fifosize - val,
314314
true,
315315
bcm_uart_writel(port, ch, UART_FIFO_REG),
316316
({}));
@@ -321,6 +321,9 @@ static void bcm_uart_do_tx(struct uart_port *port)
321321
val = bcm_uart_readl(port, UART_IR_REG);
322322
val &= ~UART_TX_INT_MASK;
323323
bcm_uart_writel(port, val, UART_IR_REG);
324+
325+
if (uart_tx_stopped(port))
326+
bcm_uart_stop_tx(port);
324327
}
325328

326329
/*

0 commit comments

Comments
 (0)