From patchwork Wed Jun 26 14:11:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 11017943 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 663DF13AF for ; Wed, 26 Jun 2019 14:14:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55CE32856D for ; Wed, 26 Jun 2019 14:14:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A5CC288D7; Wed, 26 Jun 2019 14:14:24 +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 8BE762856D for ; Wed, 26 Jun 2019 14:14:23 +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=6+ToKra+R8WZgfM99lPS6GDnLlkV98Ea1GUyZU20hmM=; b=SYXjHNSujNUUna NezlJ5FpXWfl8VRelL6YGJk10Oxo5UblE+y/Be6Y8suQ+PEO/eb3mK7Ae4OKRtTgaLonT5sGd7DCK afNRs/HhjjnG2WH8/YMdSH/XKFw1InC3XRZTO2Bwo5dlqeIEMDnjfosKSgl2BH1LyB7s6SVygTfxa mE31Ew8rt53N1T+pl4HA1hZBeT+H47T3zOglTK6G5wNUT2RcuLZb8XwQajY8p/OyyqGJBLl4idYJK 8zWo1NjXqQpi4dor9yDZKPgUz8yu1xtT9J/kaBbxmf5LX52bUtd8KtcTtN+7i/kifPu6yZUSeYuqE +ABcDLHrdbLKQK3TKTtA==; 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 1hg8gn-0003zq-Fg; Wed, 26 Jun 2019 14:14:21 +0000 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hg8gk-0003xw-Dq for linux-arm-kernel@lists.infradead.org; Wed, 26 Jun 2019 14:14:19 +0000 Received: by mail-lf1-x141.google.com with SMTP id x144so1677177lfa.9 for ; Wed, 26 Jun 2019 07:14:16 -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=WJuUxIWdx7E9MvnriBAYHhzNHu31FVqwrxDDMgUFPw0=; b=PSYYc0+B4QlGEKPAY87jv8oooLRF8PAi00CHSZQE0MfEwrUyM9o0TNWpiWUQdIiwRO PYHviZTIn9/KBUdf6K2vzJ1ZjrHbi9guDWkTvVIxyaIOeqxMz2YnoQSDCWEg1acfynrq mX+PIAw5nwfMip4Wr565dSk5slef8IMdM0Qy8bIxu2L1DDCWzCZvg6euplEJmUYfrNpY K3BEXcUG6iS1aE98zAeVsVInm1gS+2a0W57uUZ31jLjvb93R0famcl/e3O0un/+/VzeR PVGlSwH2/E/0368shAT8ticd1bPb7bUrenRSEvfaBB45PsGgkz26sYiDLG3UMJ+Blmti 8DZg== 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=WJuUxIWdx7E9MvnriBAYHhzNHu31FVqwrxDDMgUFPw0=; b=Fiu5NWlahniY2u0L726KwtSYyAIvTqtm1URb+rrP0YeavMIvjaHZ1IALWiUK6RzDKV UbPgwRHyvTZX0fFa36mnfXCqphxMtVk7XnhDIsY+V/wpaR/jyO/eDaG0X6cBwyJr6Aus zT+mUCrweXPxVIbhQEVRP33s2n7jRVFb9eA1I2tRD+iEH2Og3KkRpz2yAMYO2O3BOE1f 0sVws46pcUuAaIoZY2iTfFOJideURAtxxuxvvKsS7Y5bpZgJcXJYqXkh5Gcy6q0Ohzti HHvpF9/RfqwTeDs7Z1s2dP+vamzltkrkAZ0EWiHIPWMY1Gcl4vY7T5fSWbxuJcAc9qHy q21g== X-Gm-Message-State: APjAAAW1huSm3rL8KyQ2wsCVl6hjroI0KNdkQHg3qH2MBFgOQMygtq0Z iApon27pnDWcIoMz4osuztI= X-Google-Smtp-Source: APXvYqxc0z9OHzQhclj4HTtvYUhemdP59UMHs9KiDRvAuNViDyUoAqE676dypmM/JJBHuhpYjYQe2A== X-Received: by 2002:a19:9156:: with SMTP id y22mr2707624lfj.43.1561558455172; Wed, 26 Jun 2019 07:14:15 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id 25sm2863825ljn.62.2019.06.26.07.14.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Jun 2019 07:14:14 -0700 (PDT) From: Sergey Organov To: Sascha Hauer Subject: [PATCH v2 0/7] serial: imx: fix RTS and RTS/CTS handling Date: Wed, 26 Jun 2019 17:11:26 +0300 Message-Id: <1561558293-7683-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-20190626_071418_493464_CF994BE3 X-CRM114-Status: UNSURE ( 9.07 ) X-CRM114-Notice: Please train this message. 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 RTS signal and RTS/CTS handshake handling had a few problems these patches fix. In addition, minor cleanups are made to the involved code. Changelog: v2: * Appended: "Reviewed-by:" and "Tested-by:" Sascha Hauer * Removed "RFC" from header 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(-) --- 2.10.0.1.g57b01a3