提交 48669b69 编写于 作者: U Uwe Kleine-König 提交者: Greg Kroah-Hartman

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: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 18665414
...@@ -651,6 +651,9 @@ static void imx_start_tx(struct uart_port *port) ...@@ -651,6 +651,9 @@ static void imx_start_tx(struct uart_port *port)
struct imx_port *sport = (struct imx_port *)port; struct imx_port *sport = (struct imx_port *)port;
u32 ucr1; u32 ucr1;
if (!sport->port.x_char && uart_circ_empty(&port->state->xmit))
return;
if (port->rs485.flags & SER_RS485_ENABLED) { if (port->rs485.flags & SER_RS485_ENABLED) {
u32 ucr2; u32 ucr2;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册