diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2018-03-02 11:07:29 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-09 19:21:02 +0100 |
commit | 48669b69e3ecbabbd2936fbbe095901ba83a37f9 (patch) | |
tree | 098d6397cf766169447427566f0fcebb5d899fba /drivers/tty | |
parent | serial: imx: Fix handling of TC irq in combination with DMA (diff) | |
download | linux-48669b69e3ecbabbd2936fbbe095901ba83a37f9.tar.xz linux-48669b69e3ecbabbd2936fbbe095901ba83a37f9.zip |
serial: imx: don't prepare to send if no data is available
serial_core might call the .start_tx callback without any data being
available to send. In this case return early instead of going through
all the setup needed for sending which might include disabling RX in
RS485 half-duplex mode.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/imx.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 80456ea2603a..3a954194d2f6 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -651,6 +651,9 @@ static void imx_start_tx(struct uart_port *port) struct imx_port *sport = (struct imx_port *)port; u32 ucr1; + if (!sport->port.x_char && uart_circ_empty(&port->state->xmit)) + return; + if (port->rs485.flags & SER_RS485_ENABLED) { u32 ucr2; |