Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp503945imm; Wed, 11 Jul 2018 06:21:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfys7E0CZPMVrZscNXgmSbpBrmzNZJchXu6D/GT8fK22La0mLALnuMmg75qfAsrEvaZozmn X-Received: by 2002:a63:d704:: with SMTP id d4-v6mr13088944pgg.312.1531315310102; Wed, 11 Jul 2018 06:21:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531315310; cv=none; d=google.com; s=arc-20160816; b=OFrGaPeRFrj/k6RblauwjT6Up54s91EvMq+2PUyRvuCiBtp6dVZNX0TW9D1Te1w4h+ DbD2AHH0CDpf3gmpscaTo/aw692GTuqHv8lrRt9rGCpNBham/S5vjr2s9cDcZtN6CgpO Vaj25VWDNwA76/eBsHe+gPBjhsPXtmtW9JTpFUMZ9gQNbtBiS2QfQV7ce7feoWtrQMuE j3rhrL5Zai2SYmMHLYz8T1AkXCbHD/S1a0fFjYetj5cZj9pbXFa953N0fBTJzhHqix7Z 812SmhbOxLuK2wNFMcDcDIihGg7tTO8t9x1IpgmotUa327jDLA1tU6DrdAVyqIKUCZ9f a+xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=wExEcKZ58/WtNAw0JmY9JAGx60geU2BSlugwDhyeqXY=; b=auoPQKsUkBQUWjDjW+2zfdZslN4qEQAJ7HdKIuy/p0seXfvgeCwIfftRamcUttiOOh I5wFjLW5eaIzvIqcuhInb3tUj4yAV5Mvd+DtyM/tM9pUNewrSWgqP9k36mkikWF5KbHS jMvPqcWWiNA80WiBst6CWn5EaOY8oe4MYjiA87uWgN+wNZOWZcCWYVts/1RSQJNPXp5I o2iwKROX65HucXILP+jsi1E4d5wdovtlODSDbiQ8cJ7l6PPAevUOuCzdZDbSLQbDXDXf 95m1HpKww0LPQcgiBDSUFb7bxfTzPL3a2pLsEAAK0addORUyOMx4Hxjape8VnJg2gfxo 1CzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5-v6si20280675plc.203.2018.07.11.06.21.34; Wed, 11 Jul 2018 06:21:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387799AbeGKNZG (ORCPT + 99 others); Wed, 11 Jul 2018 09:25:06 -0400 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:21760 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732434AbeGKNZF (ORCPT ); Wed, 11 Jul 2018 09:25:05 -0400 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: , , CC: , , , , , , 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 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); + } /* -- 2.12.2