From patchwork Thu Jul 4 13:00:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 11031469 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 854BD112C for ; Thu, 4 Jul 2019 13:02:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7319628751 for ; Thu, 4 Jul 2019 13:02:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66A7228985; Thu, 4 Jul 2019 13:02:41 +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 1F61528751 for ; Thu, 4 Jul 2019 13:02:41 +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=ahdMQP6lEV4tGgnZAaOIIIgU0tFTlg1l0fAywLKsNMU=; b=PyZCi9QgNjHut8F0mCluQVFxbl cM8fKcRhSZAOU6W2F7MlhEsKsNgrIh9VNaKn4vFBVt+jzL92tDpTeJtKem4zXF1UbWFGCWhxmhR1Q VVeJKZgp2xmQRIVRdtGpO3k/YOS2M0COHbUR1ru+SzQo6SR10BAy6dHnCVO8wJjs1F1a79qPIo05f Te5EwnjpEqZ9R7OI1l5J54QeG2ajOsKgkRblRJQ5eKtV1lSXWpcGBtN1HbGkRRQtbDG6s3qNYKD5J RVSE5LwII6xhX7pWzvTmdawWNcH2uFEi/5qLW3sO31KtDmJbmGHWIj71qeiIeLC5XkLOsV+nSLRqy Jm+3Q8lg==; 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 1hj1Ni-0001JT-Rv; Thu, 04 Jul 2019 13:02:34 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hj1MJ-0008U8-WE for linux-arm-kernel@lists.infradead.org; Thu, 04 Jul 2019 13:01:09 +0000 Received: by mail-lj1-x244.google.com with SMTP id 131so6104173ljf.4 for ; Thu, 04 Jul 2019 06:01:07 -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=SyDWki8L8NcXuBPDzCdM3r3fpSMLCvKmwBmXWEoRaTo=; b=JgjQ4YYJtuKFcxmWKZHgny5RPwXpt+nC4RcNKN7GHS/mwiaf7JL4ZM9yhTjk6TrdQK 2jlHi6886KivLreGvz9b32HD9aCkjZaLaibFhdk8rWXYYLZAv3t072HcN8z9DejLdDab kuZVMyH+JwwypPNeoh+TrQZiuxyQQt/EbJf/inlcRbXv1u+3xFl/zS5LvV0VNcnSC3TN srRhdLgoComXjILvfwCdtQIPOSaVAaIwU5NoIxjzNC2k4L2gETTfLApcsMA7TCpJ0RFj 12pmiJ6khJ4biLW9Ui8OMZJYaWyoDNjDMEBIxmiSF4mzaDbgYOWPbU8il1Rc5lHZr9jv e/vQ== 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=SyDWki8L8NcXuBPDzCdM3r3fpSMLCvKmwBmXWEoRaTo=; b=f+dq6o9SovxxDpQY1YwbCgHiCuJDo9jI4QqkEd4G6TlfEmk5K0fAcRJxZsD6IjlIh2 P9UPJARdG5lEPsyLSktSMICa2jvAgHQngMVTZJM4kcwLJ5F4DzWZ+bvd8JxVsBcmGi7g ZsXuDqW2w7dbfDMd8FZ8Ur87+uPZl8bd9arB/E60tXQaf0ffH0bFH5at9A19K62AaxuW E46rX+iqcjsvvqjoU9jIvpbGoHmIDGTYRSo/maOD5qUsfhlRSblMLTl1w2F5beOc8D+8 Lz0sysu1hwZSNFGYoEdaQPHeUjip0ldoQIaT8rBvfYymHx7dvqsYmpt7rh4szQ2WHL0e 7x6Q== X-Gm-Message-State: APjAAAUxxUxpv1LPY1Fsb/z+1YW+i3yQFYrGQEY6pPOCTNrQqniZ1PP1 pSUcBNnvxlCWeYs9659I9CM= X-Google-Smtp-Source: APXvYqyqK8GICe53xP/lgQ6CIujxjkUSwEwiwZV5tINqS+mXysxT97isy6FNRj8B4IC9m+Ngqp6cEg== X-Received: by 2002:a2e:9858:: with SMTP id e24mr24094920ljj.91.1562245266664; Thu, 04 Jul 2019 06:01:06 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id h1sm485914lfj.21.2019.07.04.06.01.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Jul 2019 06:01:06 -0700 (PDT) From: Sergey Organov To: linux-serial@vger.kernel.org Subject: [PATCH v3 5/7] serial: imx: set_termios(): do not enable autoRTS if RTS is unset Date: Thu, 4 Jul 2019 16:00:27 +0300 Message-Id: <1562245229-709-6-git-send-email-sorganov@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1562245229-709-1-git-send-email-sorganov@gmail.com> References: <20190614072801.3187-1-s.hauer@pengutronix.de> <1562245229-709-1-git-send-email-sorganov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190704_060108_109339_B6ACD49E X-CRM114-Status: GOOD ( 12.95 ) 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: Greg Kroah-Hartman , Sascha Hauer , Sergey Organov , NXP Linux Team , Pengutronix Kernel Team , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , linux-arm-kernel@lists.infradead.org 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index e0f5365..5532887 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 */ @@ -1588,8 +1589,9 @@ imx_uart_set_termios(struct uart_port *port, struct ktermios *termios, else imx_uart_rts_inactive(sport, &ucr2); - } else if (termios->c_cflag & CRTSCTS) + } else if (termios->c_cflag & CRTSCTS) { imx_uart_rts_auto(sport, &ucr2); + } if (termios->c_cflag & CRTSCTS) ucr2 &= ~UCR2_IRTS;