linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ludovic Desroches <ludovic.desroches@microchip.com>
To: <linux-serial@vger.kernel.org>, <linux-arch@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Cc: <gregkh@linuxfoundation.org>, <jslaby@suse.com>, <arnd@arndb.de>,
	<richard.genoud@gmail.com>, <nicolas.ferre@microchip.com>,
	<alexandre.belloni@bootlin.com>, <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/3] tty/serial: atmel: manage shutdown in case of RS485 or ISO7816 mode
Date: Wed, 11 Jul 2018 15:16:38 +0200	[thread overview]
Message-ID: <20180711131638.12622-4-ludovic.desroches@microchip.com> (raw)
In-Reply-To: <20180711131638.12622-1-ludovic.desroches@microchip.com>

From: Nicolas Ferre <nicolas.ferre@microchip.com>

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.

Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
---
 drivers/tty/serial/atmel_serial.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 0118b219f3a8..e4f877e1f3c6 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -617,7 +617,9 @@ static void atmel_stop_tx(struct uart_port *port)
 	if (((port->rs485.flags & SER_RS485_ENABLED) &&
 	     !(port->rs485.flags & SER_RS485_RX_DURING_TX)) ||
 	    port->iso7816.flags & SER_ISO7816_ENABLED)
-		atmel_start_rx(port);
+		if (!atomic_read(&atmel_port->tasklet_shutdown))
+			atmel_start_rx(port);
+
 }
 
 /*
-- 
2.12.2


  parent reply	other threads:[~2018-07-11 13:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-11 13:16 [PATCH 0/3] add ISO7816 support Ludovic Desroches
2018-07-11 13:16 ` [PATCH 1/3] tty/serial_core: add ISO7816 infrastructure Ludovic Desroches
2018-07-11 21:52   ` kbuild test robot
2018-07-12  0:10   ` kbuild test robot
2018-07-12 14:58   ` Greg KH
2018-07-13  8:01     ` Ludovic Desroches
2018-07-19 11:07       ` Alan Cox
2018-07-12 15:02   ` Greg KH
2018-07-13  7:56     ` Ludovic Desroches
2018-07-13  8:16       ` Greg KH
2018-07-11 13:16 ` [PATCH 2/3] tty/serial: atmel: add ISO7816 support Ludovic Desroches
2018-07-12 15:01   ` Greg KH
2018-07-11 13:16 ` Ludovic Desroches [this message]
2018-07-12 14:59   ` [PATCH 3/3] tty/serial: atmel: manage shutdown in case of RS485 or ISO7816 mode Greg KH
2018-07-11 13:26 ` Ludovic Desroches
2018-07-12 14:58   ` Greg KH
2018-07-12 15:23     ` Ludovic Desroches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180711131638.12622-4-ludovic.desroches@microchip.com \
    --to=ludovic.desroches@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=richard.genoud@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).