From patchwork Thu Jun 20 14:47:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 11006839 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 63C89112C for ; Thu, 20 Jun 2019 14:48:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5489A20502 for ; Thu, 20 Jun 2019 14:48:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 485202239C; Thu, 20 Jun 2019 14:48:21 +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 BD70D20502 for ; Thu, 20 Jun 2019 14:48:20 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=qQcBs76/1N+X7WkRF7bE4FQPfcmkuPPk1F4dtb1nZ8E=; b=VffLaI/msIrcWV DrZIRzP3DRGWGo1sSbGmnBevoEKvYWwA/eOaX5GKxOgYokqmHrOcN/07jQkCUQWV5wifaBgkLspDQ Sqq66QNFjIL0SYmCo8LkYDmzvDhsG8VkYQQ5jqT/L5bpHj0gjcJ3ubIrMzZwkwlfMiKCZtcjRdSkU M47PioX7ZZkt5VAxq1CA/CNyhFR5/p3ZKt34gtvp39KzTOeSIGJbaQbTmohD1o2E+RBC0N1o4lIIe +gXp6rxj5EMNPz4+vX2zOT7J36mf5E1+ZRAk6AYX+ozfYYRJbKKYvI3RH1iLHq4LJA3C7ZJB1T3oQ vGtjoG9+ymZQkBweQpww==; 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 1hdyMG-0003lw-BV; Thu, 20 Jun 2019 14:48:12 +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 1hdyMC-0003iL-Q2 for linux-arm-kernel@lists.infradead.org; Thu, 20 Jun 2019 14:48:10 +0000 Received: by mail-lj1-x244.google.com with SMTP id v24so2928431ljg.13 for ; Thu, 20 Jun 2019 07:48:08 -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 :mime-version:content-transfer-encoding; bh=GrUwatgKfRETWcIOI87bY9cay5YKvy8zjzEuCkPjsuY=; b=a/o6N+hTwZ+lrx5CJoloqhlv1pHvXMtuoxcloninxKoLN0WQs14UVYgEdzCYSH7Pcz plJWpf8NGVOLqb5GNQd6RLqbQxiUrPEvjlMwlc56+w2MP+olNvYvNZpPWPH7gF1f9h/y 4ROsSck7mpEnLBhsWqC+FOrhRjqCjA17/vuGJkv3LW7ufo+KI+XjKD8AXRuRVciENi9t 7NuBb4EVUXd5XDJG3ClAtIpdyOqwkSy58s3/eGN1UzQ9C9tTYYGjyqtKUWG9tEP47B5h UZ5ATVAI5G1PyYn0Tz72gvseK6ws9wJLN2vBsYq2H3PdAzk+wp6d9Gok3IRWsI9bmxmk YJLg== 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:mime-version:content-transfer-encoding; bh=GrUwatgKfRETWcIOI87bY9cay5YKvy8zjzEuCkPjsuY=; b=GYyLx2aFIo3kJk8fnbQbXZlCDjG7aRfR7Fnf13r4KX2p+i2VIFARbW8P257F4ttxru eJWccAg7RU8l4Y2LW5dyCL+FGvhXNHLVSLwM9ghlFsb9xLZShnbGctYLA4MZ1/Zmp08o Xuu65rkLzUdtJ0B8/zF+XIF3wPZX9nAvHhNTifyBGG4XWsx3fsFjM0yqUOVldiA51SEd BWuljxZGI/qI/1sQhSgNy6DJdIbb9o0MTPPSBQXMRVBFFsVDFq9uj7F4ODMnk7WXHhbm Jv/JhrdkrC2xxJv8B40HCHuGCWnZiXskP1axp/TetCiIrl9XaciRiVZCcd9qQmLXmQtQ RY6g== X-Gm-Message-State: APjAAAVvYhPHOvYNtHretsDlNk6cdcJVWHOgTFZec3I9z7Tpu1gORSjc l8MGjPTNGoTbr3h1pbnrlDQ= X-Google-Smtp-Source: APXvYqyK/pqyU6S3QbQf7S/2Ho1sMdLUU9XqeUG1Z4xZ49ccKg246cCv6SsEfL0ddj1t4c2Em2upYg== X-Received: by 2002:a2e:8613:: with SMTP id a19mr8732452lji.163.1561042086924; Thu, 20 Jun 2019 07:48:06 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id f10sm3577768ljk.95.2019.06.20.07.48.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Jun 2019 07:48:06 -0700 (PDT) From: Sergey Organov To: Sascha Hauer Subject: [PATCH RFC v1 0/7] serial: imx: fix RTS and RTS/CTS handling Date: Thu, 20 Jun 2019 17:47:46 +0300 Message-Id: <1561042073-617-1-git-send-email-sorganov@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <20190614072801.3187-1-s.hauer@pengutronix.de> References: <20190614072801.3187-1-s.hauer@pengutronix.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190620_074808_887917_91609855 X-CRM114-Status: GOOD ( 10.09 ) 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?= 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 The patches are not tested yet, so the RFC in the header. I'll re-roll without RFC once Sasha Hauer tests them. Sasha, in addition to already discussed fixes, I've also reordered 2 patches so that the sequence makes sense. Changelog: v1: * Fixed in "serial: imx: set_termios(): preserve RTS state" -+ ucr2 = UCR2_SRST | UCR2_IRTS; ++ ucr2 |= UCR2_SRST | UCR2_IRTS; as noticed by Lothar Waßmann * Fixed in "serial: imx: set_termios(): preserve RTS state" -+ ucr2 = old_ucr2 & (UCR2_TXEN | UCR2_RXEN | UCR2_ATEN | UCR2_CTSC); ++ ucr2 = old_ucr2 & (UCR2_TXEN | UCR2_RXEN | UCR2_ATEN | UCR2_CTS); as the fix for the problem found by Sascha Hauer * Reordered: serial: imx: set_termios(): preserve RTS state serial: imx: set_termios(): do not enable autoRTS if RTS is unset as the latter makes sense only provided the former is already applied. Sergey Organov (7): serial: imx: fix locking in set_termios() serial: imx: set_termios(): factor-out 'ucr2' initial value serial: imx: set_termios(): clarify RTS/CTS bits calculation serial: imx: set_termios(): preserve RTS state serial: imx: set_termios(): do not enable autoRTS if RTS is unset serial: imx: set_mctrl(): correctly restore autoRTS state serial: imx: get rid of imx_uart_rts_auto() drivers/tty/serial/imx.c | 93 ++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 46 deletions(-) Reviewed-by: Sascha Hauer Tested-by: Sascha Hauer --- 2.10.0.1.g57b01a3