summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@microchip.com>2020-02-10 16:20:53 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-28 15:42:48 +0100
commit8448625a3574dfa2c3c489bd5a522622101d3b3b (patch)
tree42bc386bf53aa1dc7ec30fbab24f482fa31e4c2f /drivers/tty
parent9d69b4a72283a52a96a535c9d2da738980eede8c (diff)
tty/serial: atmel: manage shutdown in case of RS485 or ISO7816 mode
commit 04b5bfe3dc94e64d0590c54045815cb5183fb095 upstream. 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>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/atmel_serial.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 325f9db2da86..4a7eb85f7c85 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -501,7 +501,8 @@ static void atmel_stop_tx(struct uart_port *port)
atmel_uart_writel(port, ATMEL_US_IDR, atmel_port->tx_done_mask);
if (atmel_uart_is_half_duplex(port))
- atmel_start_rx(port);
+ if (!atomic_read(&atmel_port->tasklet_shutdown))
+ atmel_start_rx(port);
}