mirror of
https://github.com/torvalds/linux.git
synced 2024-12-14 15:13:52 +00:00
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>
This commit is contained in:
parent
52fa786609
commit
932d596378
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user