提交 5aabd3b0 编写于 作者: I Ian Jamison 提交者: Greg Kroah-Hartman

serial: imx: Avoid post-PIO cleanup if TX DMA is started

The imx_transmit_buffer function should return if TX DMA has already
been started and not just skip over the buffer PIO write loop. (Which
did fix the initial problem, but could have unintentional side-effects)

Tested on an i.MX6Q board with half-duplex RS-485 and with RS-232.

Cc: Clemens Gruber <clemens.gruber@pqgruber.com>
Cc: Uwe-Kleine König <u.kleine-koenig@pengutronix.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Fixes: 514ab34d ("serial: imx: Prevent TX buffer PIO write when a DMA has been started")
Signed-off-by: NIan Jamison <ian.dev@arkver.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 81b289cc
......@@ -457,7 +457,10 @@ static inline void imx_transmit_buffer(struct imx_port *sport)
}
}
while (!uart_circ_empty(xmit) && !sport->dma_is_txing &&
if (sport->dma_is_txing)
return;
while (!uart_circ_empty(xmit) &&
!(readl(sport->port.membase + uts_reg(sport)) & UTS_TXFULL)) {
/* send xmit->buf[xmit->tail]
* out the port here */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册