From patchwork Wed Jun 26 14:11:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 11017955 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B7560924 for ; Wed, 26 Jun 2019 14:16:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A076A287C5 for ; Wed, 26 Jun 2019 14:16:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94BC8288B9; Wed, 26 Jun 2019 14:16:43 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 DB22C287C5 for ; Wed, 26 Jun 2019 14:16:40 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=1s5jGfzFGkuG5VKOHxHoU3/ZPrQwCuIWharDSgFbHIQ=; b=mERX0zoHZqK8ZBHTnEDUMay/tA XVqdQtG3ZEMu7aqvQppnIp/IpV+ZHoi0eSFmUkobZQNBX4uqJTwG+ndptwbsg7WSRJAqdgI0WjdtP 0Q1ICG/YOLY+es1zCD4UgBB8082CuzzWQD8AF69Zrmth7sjMl57AS3APDzWVKBPN9LW2yS5x9zyUf MCqsnky0x+wm4+2Fx27DUmD8C5F80qyxvAeP7tB2yVpsVdwgGBJBngh5I6p/esKAwQ3iPxpI/yQXs yqyWSrXAYFFS6/K4riIbUShKjDF44s7C1fIJe092mzfQZZS661XWNL0bTBtMEUZ23p00UrlYYXA3Q V+nzwGTQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hg8j0-0006bF-Qw; Wed, 26 Jun 2019 14:16:39 +0000 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hg8go-0003ym-KS for linux-arm-kernel@lists.infradead.org; Wed, 26 Jun 2019 14:14:24 +0000 Received: by mail-lj1-x243.google.com with SMTP id 131so2385862ljf.4 for ; Wed, 26 Jun 2019 07:14:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PSCP97EAMw9kJ5xr2biP47mIP/F/75GsSBuiL+rMzdw=; b=mqUioiLReGnEQt+HM3TnWMKitnMv4iEElkv3Gxq/nhULQPVKwjqcrzDEiooO2YoSVo iM1wtpbL3kCH2M2N6HPi3q7Dhtr0Bxo9RY6kiySEIPyxEmbhw+FUIh5vmMV95XuR3USl 3EwQR+oSAGzlbo9eXaCP4cgS+DqXhTSHrsbt0TrpUSBBs5cRhywaFhUs4GKeOKcRiJ/x lCZVoj2RwhLu0G6nKLjevdfPaLJFpeJ/d4ID0VICG1G/csP2GrXd59yDmfUH+5hxkTxn TJhxWbOsYSHXtjqreBzsCLFGM7p0nxGCY3xLAsCbGmW5TIzMQCEpgITjWW6S3sguJKeA oC6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PSCP97EAMw9kJ5xr2biP47mIP/F/75GsSBuiL+rMzdw=; b=ZIVROju8BMcYoNXAVWQT5bAbWBR2i9m0TWz0dVRLZQwb6ROpj27ORNo/fHA8RbEB9P q4LdFtOMHWPQ11zuGA9C9rMFKuxomUOFIfYnwjr4jlxOKhY6v+NyX8ysXHoOkdPlfU5S F057uTZSKzZhT0wiV5xJmYh23mEEfS699DRDolxl+jDcKniFr7Yp7jJgiXCiy3e7vhC9 j+hW7ri9t+3LUzFpE1VutBxkZMTFGTUSM0pW6TQFpl+NtNunq88OrD6dGTytf3f7b0xt Nth7qF2BnSxq0eEuTJsg8JRffqMPI2DlsP7njdKbQJ1+l9+HCMbCgV4hZSyhVzveeQC4 MvXQ== X-Gm-Message-State: APjAAAWdGx559vLptn4icIHBqGZxPuumYFiXMtTmRbobAm3keBxSl1E9 lATxw+4Kp2MjH4VaBUZxRjs= X-Google-Smtp-Source: APXvYqyuTVynFjGEcA3fo0upN/VPg2m8WVsm9Rnt8JOCdPSLblri7wBfunfXN82sWRjbNSecicxmbA== X-Received: by 2002:a2e:9b03:: with SMTP id u3mr3086619lji.15.1561558459745; Wed, 26 Jun 2019 07:14:19 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id 25sm2863825ljn.62.2019.06.26.07.14.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Jun 2019 07:14:19 -0700 (PDT) From: Sergey Organov To: Sascha Hauer Subject: [PATCH v2 5/7] serial: imx: set_termios(): do not enable autoRTS if RTS is unset Date: Wed, 26 Jun 2019 17:11:31 +0300 Message-Id: <1561558293-7683-6-git-send-email-sorganov@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1561558293-7683-1-git-send-email-sorganov@gmail.com> References: <20190614072801.3187-1-s.hauer@pengutronix.de> <1561558293-7683-1-git-send-email-sorganov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190626_071422_723484_77163AE1 X-CRM114-Status: GOOD ( 12.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pengutronix Kernel Team , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= MIME-Version: 1.0 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 set_termios() shouldn't set UCR2_CTSC bit if UCR2_CTS (=TIOCM_RTS) is cleared. Added corresponding check in imx_uart_rts_auto() to fix this. Reviewed-by: Sascha Hauer Tested-by: Sascha Hauer Signed-off-by: Sergey Organov --- drivers/tty/serial/imx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index e0f5365..4867f80 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -405,7 +405,8 @@ static void imx_uart_rts_inactive(struct imx_port *sport, u32 *ucr2) /* called with port.lock taken and irqs caller dependent */ static void imx_uart_rts_auto(struct imx_port *sport, u32 *ucr2) { - *ucr2 |= UCR2_CTSC; + if (*ucr2 & UCR2_CTS) + *ucr2 |= UCR2_CTSC; } /* called with port.lock taken and irqs off */