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: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220217211839.443039-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
pull/549/merge
Steffen Trumtrar 2022-02-17 22:18:39 +01:00 committed by Greg Kroah-Hartman
parent 52fa786609
commit 932d596378
1 changed files with 3 additions and 0 deletions

View File

@ -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;