On Tue, Apr 02, 2019 at 12:52:50PM +0300, Razvan Stefanescu wrote: > commit 69646d7a3689 ("tty/serial: atmel: RS485 HD w/DMA: enable RX after TX is stopped") upstream. > > In half-duplex operation, RX should be started after TX completes. > > If DMA is used, there is a case when the DMA transfer completes but the > TX FIFO is not emptied, so the RX cannot be restarted just yet. > > Use a boolean variable to store this state and rearm TX interrupt mask > to be signaled again that the transfer finished. In interrupt transmit > handler this variable is used to start RX. A warning message is generated > if RX is activated before TX fifo is cleared. > > Fixes: b389f173aaa1 ("tty/serial: atmel: RS485 half duplex w/DMA: enable > RX after TX is done") > Signed-off-by: Razvan Stefanescu <razvan.stefanescu@xxxxxxxxxxxxx> > Acked-by: Richard Genoud <richard.genoud@xxxxxxxxx> > Cc: stable <stable@xxxxxxxxxxxxxxx> > Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> > --- > drivers/tty/serial/atmel_serial.c | 24 +++++++++++++++++++++--- > 1 file changed, 21 insertions(+), 3 deletions(-) > Happen to have a version of this for 4.4.y and 4.9.y? I've queued both of these patches up now, thanks. greg k-h