Commit 932d5963 authored by Steffen Trumtrar's avatar Steffen Trumtrar Committed by Greg Kroah-Hartman

serial: 8250: Return early in .start_tx() if there are no chars to send

Don't start the whole chain for TX if there is no data to send. This is
mostly relevant for rs485 mode as there might be rts-before-send and
rts-after-send delays involved.
Signed-off-by: default avatarSteffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220217211839.443039-1-u.kleine-koenig@pengutronix.deSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 52fa7866
......@@ -1665,6 +1665,9 @@ static void serial8250_start_tx(struct uart_port *port)
serial8250_rpm_get_tx(up);
if (!port->x_char && uart_circ_empty(&port->state->xmit))
return;
if (em485 &&
em485->active_timer == &em485->start_tx_timer)
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment