Skip to content

Commit

Permalink
tty/serial: atmel: manage shutdown in case of RS485 or ISO7816 mode
Browse files Browse the repository at this point in the history
commit 04b5bfe 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: 98f2082 ("tty/serial: atmel: enforce tasklet init and termination sequences")
Signed-off-by: Nicolas Ferre <[email protected]>
Cc: stable <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
noglitch authored and gregkh committed Feb 28, 2020
1 parent 9d69b4a commit 8448625
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/tty/serial/atmel_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}

Expand Down

0 comments on commit 8448625

Please sign in to comment.