From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D82CC54FEE for ; Thu, 27 Feb 2020 14:32:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0BF9224656 for ; Thu, 27 Feb 2020 14:32:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582813924; bh=snVZpr8Tc1ya9pgap+qDI7pE4d1cCVzZv7mgLWud5jc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=q7MIRRNV7uIA4jpEckdIfDng8nyElpGuuhQBLEc80fVguzZHdXE8fVg8H/Vhapw5x ugEGRBcEHBL4Y/vExpGTnmIUiAKdcr3bi0skibJOCVGfn33ZAEJQV2+vMRi2DOb73W 8bauxuOzhUPp9CP6jG9pUkkbpCYKQxLX5+zzDk/g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733163AbgB0OCg (ORCPT ); Thu, 27 Feb 2020 09:02:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:37228 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733137AbgB0OCc (ORCPT ); Thu, 27 Feb 2020 09:02:32 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 25C4F20578; Thu, 27 Feb 2020 14:02:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582812151; bh=snVZpr8Tc1ya9pgap+qDI7pE4d1cCVzZv7mgLWud5jc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BhKy47Wphif89SbAPNxa3gMlpX4cH35siByvnJ6aFzb5mC3gc09eOeA3jgCb7WLpz Pzj9UPK+wSQPXab9efg1zaz1k1/mAC+AR5r9juTxu0JkLir22TZXeLH8fl/X+PEkcw noQapM5GkvvTDIRTnO7HkVCKv9g0sxoAXFFgRIYI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicolas Ferre Subject: [PATCH 4.14 193/237] tty/serial: atmel: manage shutdown in case of RS485 or ISO7816 mode Date: Thu, 27 Feb 2020 14:36:47 +0100 Message-Id: <20200227132310.526193773@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227132255.285644406@linuxfoundation.org> References: <20200227132255.285644406@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicolas Ferre commit 04b5bfe3dc94e64d0590c54045815cb5183fb095 upstream. 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 Cc: stable Link: https://lore.kernel.org/r/20200210152053.8289-1-nicolas.ferre@microchip.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/atmel_serial.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -498,7 +498,8 @@ static void atmel_stop_tx(struct uart_po 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); }