Linux-Serial Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] tty/serial: atmel: manage shutdown in case of RS485 or ISO7816 mode
@ 2020-02-10 15:20 Nicolas Ferre
  2020-02-12 11:19 ` Richard Genoud
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Ferre @ 2020-02-10 15:20 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Richard Genoud, linux-serial
  Cc: Alexandre Belloni, Ludovic Desroches, linux-arm-kernel,
	linux-kernel, Codrin Ciubotariu, Nicolas Ferre

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>
---
 drivers/tty/serial/atmel_serial.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index c15c398c88a9..a39c87a7c2e1 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -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);
 
 }
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] tty/serial: atmel: manage shutdown in case of RS485 or ISO7816 mode
  2020-02-10 15:20 [PATCH] tty/serial: atmel: manage shutdown in case of RS485 or ISO7816 mode Nicolas Ferre
@ 2020-02-12 11:19 ` Richard Genoud
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Genoud @ 2020-02-12 11:19 UTC (permalink / raw)
  To: Nicolas Ferre, Greg Kroah-Hartman, linux-serial
  Cc: Alexandre Belloni, Ludovic Desroches, linux-arm-kernel,
	linux-kernel, Codrin Ciubotariu

Le 10/02/2020 à 16:20, Nicolas Ferre a écrit :
> 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>

Acked-by: Richard Genoud <richard.genoud@gmail.com>

> ---
>  drivers/tty/serial/atmel_serial.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> index c15c398c88a9..a39c87a7c2e1 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -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);
>  
>  }
>  
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10 15:20 [PATCH] tty/serial: atmel: manage shutdown in case of RS485 or ISO7816 mode Nicolas Ferre
2020-02-12 11:19 ` Richard Genoud

Linux-Serial Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-serial/0 linux-serial/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-serial linux-serial/ https://lore.kernel.org/linux-serial \
		linux-serial@vger.kernel.org
	public-inbox-index linux-serial

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-serial


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git