Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty/serial: atmel: manage shutdown in case of RS485 or ISO7816 mode

In atmel_shutdown() we call atmel_stop_rx() and atmel_stop_tx() functions.
Prevent the rx restart that is implemented in RS485 or ISO7816 modes when
calling atmel_stop_tx() by using the atomic information tasklet_shutdown
that is already in place for this purpose.

Fixes: 98f2082c3ac4 ("tty/serial: atmel: enforce tasklet init and termination sequences")
Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200210152053.8289-1-nicolas.ferre@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Nicolas Ferre and committed by
Greg Kroah-Hartman
04b5bfe3 0c5aae59

+2 -1
+2 -1
drivers/tty/serial/atmel_serial.c
··· 570 570 atmel_uart_writel(port, ATMEL_US_IDR, atmel_port->tx_done_mask); 571 571 572 572 if (atmel_uart_is_half_duplex(port)) 573 - atmel_start_rx(port); 573 + if (!atomic_read(&atmel_port->tasklet_shutdown)) 574 + atmel_start_rx(port); 574 575 575 576 } 576 577