Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3840425ybv; Mon, 10 Feb 2020 07:21:17 -0800 (PST) X-Google-Smtp-Source: APXvYqw25M7N7XLytr2b8Egy/hDlje33JBmWVF3uBHUh/8UANh2mEPl3VQlkMr+1zNEdWBg2ZU6N X-Received: by 2002:a05:6830:1db3:: with SMTP id z19mr1486830oti.292.1581348076644; Mon, 10 Feb 2020 07:21:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581348076; cv=none; d=google.com; s=arc-20160816; b=evMxBV6nF90z7z73jovfpkyNKNa0bQkx5uGYEWkqUileaWEFXkpy2U1AgBTKYIMwRj q3O4+RWC09X+16sFx2j3LdP/g4CevwB/M3bi+A0U4kXL3Teg0UvpmihbQBfwkUIlrJ19 QOFp2jXhE5FgpIH9bz6MmkID/vZt7wIUCLFwBQgMzasS0x2agMVI3KBb8vUP1KU/7fox nVZNdoadI4AIKIklRZGUOjLW/nWzf9Jw0cz/RizjcZ+4PmjrXyjsUQ68+OftC3WYWAg8 EQ5KfraECAOoWvsE9EOdCxv5EiFIneims7qxseYauYcXKps6Aur/X4WSIrhvMVAHYh26 FESw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:ironport-sdr; bh=OzTofNelODI6uawsfnBeoDoSiza6AF9VVVE4KjYEasE=; b=o4BCx+WuwXv9qc4x5dWcPhyfLO4Cr4wxrZancQZ8wwyZgQbMLpr+Y3j91/mrYeRPv9 yMso97tkiDkl6rme5LR1gUTdKnqDFD+de0n78Hlo3bQ2+i1hXu2z+FAGLaP76AldgcyU Z6imqbLsf9pmJ29dA8xpVIWjCbXddW7BzZj59NqLlxUcQD61nDoUVFxhA2jm/RcggyjN DWxTZF8Vo/ZqPfGcM7p+UEB15rMPP7+QBnkPKDUM2U16OxZEmYOGlMJA8NBi3z0iv0S2 n7TSh0hbybiJsQm+jPmdUgE11f5yLPHmccZ8RSf0D1cvjEpcvdLt2bJolpHEj/GTgcf6 XB1w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h28si354317otg.63.2020.02.10.07.21.04; Mon, 10 Feb 2020 07:21:16 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729140AbgBJPU7 (ORCPT + 99 others); Mon, 10 Feb 2020 10:20:59 -0500 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:7354 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728779AbgBJPU7 (ORCPT ); Mon, 10 Feb 2020 10:20:59 -0500 Received-SPF: Pass (esa2.microchip.iphmx.com: domain of Nicolas.Ferre@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa2.microchip.iphmx.com; envelope-from="Nicolas.Ferre@microchip.com"; x-sender="Nicolas.Ferre@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa2.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa2.microchip.iphmx.com; envelope-from="Nicolas.Ferre@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa2.microchip.iphmx.com; spf=Pass smtp.mailfrom=Nicolas.Ferre@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: L7BX/6oEt6gKL1m2Oy6RMwXq4ngWrcO4DRk/+LGzLoQu5R0PM66CboAOgPYrdaKgquHdoHCwRc oqawS8diV6MJjhb5j3a+jAHmzNinCtT2vC7FgYLgzsEpUvtmC26KjKOlHMWOKkt0R9mIQMq0dO SICv9OCg24cpxElgs6eMRL3DdB48Dqwrfccuc5FPYOTQ4Y0VrLPFN57bsa3sIUgUdYYjz3yXDz SS2tVNf31A6vGKgyhYA3tZBofrfEBFJv4sXZ9b+WnFqmltALmgBuN6cJADM0iZilOI+NUykkr3 9dI= X-IronPort-AV: E=Sophos;i="5.70,425,1574146800"; d="scan'208";a="65398876" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 10 Feb 2020 08:20:58 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 10 Feb 2020 08:20:56 -0700 Received: from tenerife.corp.atmel.com (10.10.85.251) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Mon, 10 Feb 2020 08:20:54 -0700 From: Nicolas Ferre To: Greg Kroah-Hartman , Richard Genoud , CC: Alexandre Belloni , Ludovic Desroches , , , Codrin Ciubotariu , Nicolas Ferre Subject: [PATCH] tty/serial: atmel: manage shutdown in case of RS485 or ISO7816 mode Date: Mon, 10 Feb 2020 16:20:53 +0100 Message-ID: <20200210152053.8289-1-nicolas.ferre@microchip.com> X-Mailer: git-send-email 2.17.1 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 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 --- 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