From patchwork Wed Jul 11 13:16:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ludovic Desroches X-Patchwork-Id: 10519911 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 41FA8603D7 for ; Wed, 11 Jul 2018 14:18:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 326B329240 for ; Wed, 11 Jul 2018 14:18:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2663929253; Wed, 11 Jul 2018 14:18:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D39DF29240 for ; Wed, 11 Jul 2018 14:18:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YSb/ycEI7vof2j+8Xl1m68bDYwz9uzPapONHq6+cSRA=; b=A8MNprKb4LOqFC pFUasREsqTiHRtT4COcbAsw9BkFQmv4ejgY7yidXwm5CbjfGWgmT8lIX24l6/zVaotCl1A34EgHvR ZbAhjzAvnBPgC8eI6O8XT/g3mLNWz8kiZXucyBy9EJoom2tObppN8IODroFrK7zHNOQQWB6moT9DK jrP0tkzaSFiJpdpaF9ACP7SEjCrn2saP6FiHuxEL2iM8tmFwewX932OvVSG+YCMaAL4NP/P/nksWl Yzj1uCiz2TbbWCGY1LHTFZVje6kaVOpnLwAExCTBd8DCYw9Vuh4WNCkC4uO1ToIgn2gmsGT/XyCUb ILJS9qw6Q73mtXeAsgug==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdFwz-0001gf-K3; Wed, 11 Jul 2018 14:18:37 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdFK1-00038j-1A for linux-arm-kernel@bombadil.infradead.org; Wed, 11 Jul 2018 13:38:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=wExEcKZ58/WtNAw0JmY9JAGx60geU2BSlugwDhyeqXY=; b=TI/bovVrYF8FACouhb9ELv+jJ k9Q2VgagR2lsDjxzgpW/olV+zLAbusFsBz/rBuk6bpo8pGEJzUAGEoByLEAc03kgeF5GI/Dj85w5V J2ees8cq4vteKhHbRQzpCFTOs0Rlmv/G+uJw2C4DlngYSBqe5CRo404FXQOXkhncFPVW2orze+UmQ xNyEAGiQBNOCqrcOf2gl4MddwRLkNxdlaoImI/uOtcHGu1KjRbCo9NQQhvqxGDGYD/tY9rArMlKyX V67qfMndm+dfuLtwWHvZcA60xvFk1J69+qlyZ8bBcL6o4KvfvnOVXmuud4XZW+y/27gbTx/SCIOoi vGtu1/Pgg==; Received: from esa3.microchip.iphmx.com ([68.232.153.233]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdF3E-0003yB-MH for linux-arm-kernel@lists.infradead.org; Wed, 11 Jul 2018 13:21:03 +0000 X-IronPort-AV: E=Sophos;i="5.51,338,1526367600"; d="scan'208";a="16189973" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Jul 2018 06:20:46 -0700 Received: from ibiza.rfo.atmel.com (10.10.76.4) by chn-sv-exch06.mchp-main.com (10.10.76.107) with Microsoft SMTP Server id 14.3.352.0; Wed, 11 Jul 2018 06:20:45 -0700 From: Ludovic Desroches To: , , 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 Message-ID: <20180711131638.12622-4-ludovic.desroches@microchip.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20180711131638.12622-1-ludovic.desroches@microchip.com> References: <20180711131638.12622-1-ludovic.desroches@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180711_142100_998963_686B4A0E X-CRM114-Status: GOOD ( 10.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, arnd@arndb.de, richard.genoud@gmail.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, jslaby@suse.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: 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. Signed-off-by: Nicolas Ferre --- 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); + } /*