]> git.baikalelectronics.ru Git - kernel.git/commit
serial: imx: Prevent TX buffer PIO write when a DMA has been started
authorIan Jamison <ian.dev@arkver.com>
Fri, 14 Jul 2017 16:31:57 +0000 (17:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Jul 2017 12:14:24 +0000 (14:14 +0200)
commite38c0b9046aa964f82489e7e6c357be260b4eed2
tree5ed905cb91764957f980f0055dd95db111ea9488
parent66a87c4f458241a9223e7536652b86084d5ab7ea
serial: imx: Prevent TX buffer PIO write when a DMA has been started

Function imx_transmit_buffer starts a TX DMA if DMA is enabled, since
commit 0ccae1a2e532 ("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@pqgruber.com>
Signed-off-by: Ian Jamison <ian.dev@arkver.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c