tty/serial: atmel: manage shutdown in case of RS485 or ISO7816 mode
Subsystems (3)
Nicolas Ferre
maintainerPATCH 1/1 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 <[email protected]>
--- drivers/tty/serial/atmel_serial.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/tty/serial/atmel_serial.c +2 -1
@@ -570,7 +570,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); }
Signature · 1 line
2.17.1
Le 10/02/2020 à 16:20, Nicolas Ferre a écrit :
Quoted 7 lines
In
atmel_shutdown()we callatmel_stop_rx()andatmel_stop_tx()functions. Prevent the rx restart that is implemented in RS485 or ISO7816 modes when callingatmel_stop_tx()by using the atomic informationtasklet_shutdownthat is already in place for this purpose.Fixes 98f2082c3ac4 ("tty/serial: atmel: enforce tasklet init and termination sequences")Signed-off-by Nicolas Ferre <[email protected]>
Acked-by Richard Genoud <[email protected]>
Quoted 19 lines
--- drivers/tty/serial/atmel_serial.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/tty/serial/atmel_serial.c +2
-1@@ -570,7 +570,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); }