Hi Ian, On Fri, Jul 14, 2017 at 1:31 PM, Ian Jamison <ian.dev@xxxxxxxxxx> wrote: > Function imx_transmit_buffer starts a TX DMA if DMA is enabled, since > commit 91a1a909f921 ("serial: imx: Support sw flow control in DMA mode"). > It also carries on and attempts to write the same TX buffer using PIO. > This results in TX data corruption and double-incrementing xmit->tail > with the knock-on effect of tail passing head and a page of garbage > being sent out. > > This seems to be triggered mostly when using RS485 half duplex on SMP > systems, but is probably not limited to just those. > > Tested locally on an i.MX6Q with an RS485 half duplex transceiver on > UART3, and also by Clemens Gruber. > > Tested-by: Clemens Gruber <clemens.gruber@xxxxxxxxxxxx> > Signed-off-by: Ian Jamison <ian.dev@xxxxxxxxxx> Thanks for fixing the long standing bug! Reviewed-by: Fabio Estevam <fabio.estevam@xxxxxxx> > --- > drivers/tty/serial/imx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c > index 9e3162bf3bd1..f6c37ce457c1 100644 > --- a/drivers/tty/serial/imx.c > +++ b/drivers/tty/serial/imx.c > @@ -464,7 +464,7 @@ static inline void imx_transmit_buffer(struct imx_port *sport) > } > } > > - while (!uart_circ_empty(xmit) && > + while (!uart_circ_empty(xmit) && !sport->dma_is_txing && > !(readl(sport->port.membase + uts_reg(sport)) & UTS_TXFULL)) { > /* send xmit->buf[xmit->tail] > * out the port here */ > -- > 2.13.2 > -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html