From patchwork Thu Jul 4 13:00:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 11031459 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 90A3014C0 for ; Thu, 4 Jul 2019 13:01:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DFF42896D for ; Thu, 4 Jul 2019 13:01:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F23328992; Thu, 4 Jul 2019 13:01:11 +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 065EB2896D for ; Thu, 4 Jul 2019 13:01:11 +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=oWxI1kaxuOXU8MIE4kMmBBji1AMYPdK8s/gKYh2yM5g=; b=gT+EsdYQ1+IdAx UyLhr08mO3ABEYFAqw4qHdnbHLLPsrjgxETqJA0psjVkxDvGJATIgYWRjerh6ojXcqN4E2YD1XCUY DMpbqWbhwCbWT04WGSZjRnfo6JzeiSLK+BVWi+M36nviuEmTQNYKqoFdo9cAR84e4rvOc94Bzn1Mx bA2UqcNTcF8BSuOOoNKwkc6SLKHZuLK5kk1/jx0lvQKZ7kYv2HOljO+LjxmBm1qMEaWof4EF1ijQ4 H6nXbIkOoZ9taIonbehNpm+4Lzg3lixVuw/JnUCx5MQFeIxne7gZ6U6qszvfZR+dOoggLjbz0Xe8Q 2Ru6Xj6kCUaQsbJqCPtQ==; 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 1hj1MH-0008Rz-9a; Thu, 04 Jul 2019 13:01:05 +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 1hj1MD-0008Qd-Ob for linux-arm-kernel@lists.infradead.org; Thu, 04 Jul 2019 13:01:03 +0000 Received: by mail-lj1-x244.google.com with SMTP id x25so6115640ljh.2 for ; Thu, 04 Jul 2019 06:01:01 -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=ra8RdVFYK5DBO8QxOB3FtDU0BA7sfZz2SeBlsVeKUKw=; b=pHM+Vv2BkdQUcKnCaqTF40XNspUR/QDrEJbTzJhhUvDjETu77Bx0FCDoZKRTK7whJa TechV/0jUexK/ONmNLVT8jJJi3usdA9m7HAtYEko7kw7IFB8k6odrG74zSeOAUx7UPDq Cjgsb9NpQkzeyk/Q7hB11owH+BP7psfVbrRPjj7nPROZ76PhdYMxMd93qOm6TJTwUMum pudnmiPpettfPypUUxA4XsHBZSBevpNFVPHNuhzFyp0wUaMpjxLdIBNRn0HBhi5akzRx wJmRu9w4aosxVaj5nrrdaNnqfvHRp5otxc+LfXvvk4ZZPVTXm+4wEP6zL+bSEMCqKtSk chKw== 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=ra8RdVFYK5DBO8QxOB3FtDU0BA7sfZz2SeBlsVeKUKw=; b=OCk9VOGjAX23cAkT4wzzbW7fk60gHjUh77S09r8+00cSILAB+UUC4wvGKbzKsHhQ8v PCLMB59bUtVUU1//woliqP7HSTTJKbk6WJ8ns381SxS2MI/hlYtb8Ek+yapoPCHsYpoc WGaG5xF+iWokTpE5C35rHko/PjO8omPHV2Ti13JmRwag6ak6KcfN1stFTZpe7MsX8HDR bmTZYTFUCd+Mjws/Q7Wt98yruw6NP4kLPg4WxhmhHFvPpCnv55eJs5jK9ixAU4tiQ32f 4h2i5OvvU4jsN9jv/t8uYugSreiwESSyQam/euWzV8nQTveW+HrbIL/v/cz5IUTvP0+p FU7g== X-Gm-Message-State: APjAAAV7IKzmJsEUaEIj9Qsofp+KmUYkn6eFsCZKAIJU6hu6ma5ioWbv edwcSkjn96t3Qi8jW+0ineAbJka+ X-Google-Smtp-Source: APXvYqzb8XllzW+5e3C12GZuMGbmsfh0gAivSO23lXyZdbBjGaQAK10G4UTz1E++PGtHB27u0ksKiA== X-Received: by 2002:a2e:a0d6:: with SMTP id f22mr2956590ljm.182.1562245259689; Thu, 04 Jul 2019 06:00:59 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id h1sm485914lfj.21.2019.07.04.06.00.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Jul 2019 06:00:58 -0700 (PDT) From: Sergey Organov To: linux-serial@vger.kernel.org Subject: [PATCH v3 0/7] serial: imx: fix RTS and RTS/CTS handling Date: Thu, 4 Jul 2019 16:00:22 +0300 Message-Id: <1562245229-709-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-20190704_060101_807028_5C0D9614 X-CRM114-Status: GOOD ( 10.08 ) 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 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: v3: * Appended: "Reviewed-by:" Uwe Kleine-König to the first 2 patches * Added braces to one-line 'else if', to the "serial: imx: set_termios(): clarify RTS/CTS bits calculation", as suggested by Uwe Kleine-König * Improved comments in "serial: imx: set_mctrl(): correctly restore autoRTS state", as suggested by Uwe Kleine-König 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 | 96 +++++++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 46 deletions(-) --- 2.10.0.1.g57b01a3