From patchwork Fri Jul 19 08:47:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 11049875 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 1591313AC for ; Fri, 19 Jul 2019 08:48:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 048D128884 for ; Fri, 19 Jul 2019 08:48:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC69828895; Fri, 19 Jul 2019 08:48:35 +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 6A1DB28884 for ; Fri, 19 Jul 2019 08:48:35 +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=gLpfQLn6TBNJhrFFpYmM5JERhgUb51qtvEjJwq/jKik=; b=u3F9bpYVpOAStw YN1BpGxFjOev8BDOyS45co2M++0q9wLz+f/bBJkmIA9LTTOQT3YuomeTcBHTKCHXD2b5oR0GLxvnB fSLpBTRWcf9qz0VrteFy3Lc/erq12tOJx7B07qFIgQ1fKR9o2wQQ1yFpU6lfNYwLwtImq876Pxywh z6OcA+vSGw/HfP1ww+3GUxzdrFYPNywm9Lo2jyvJVYanY1qBka6hufCdaa7bgG9UFF+zU/GbgTZXq u8fOJrMBAwOqSPghW5k5ROMHv+JBb3Xt8ZTJQwdvrVxkGoHfSycpMSMFENoxjq492j1BNI0oYTvcy piByIayRjEWLvPacKrJg==; 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 1hoOZ9-0000Vk-1Y; Fri, 19 Jul 2019 08:48:35 +0000 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hoOYn-0000Fd-OM for linux-arm-kernel@lists.infradead.org; Fri, 19 Jul 2019 08:48:15 +0000 Received: by mail-lf1-x142.google.com with SMTP id z15so16905518lfh.13 for ; Fri, 19 Jul 2019 01:48:13 -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=oto3ZKEBO7uNTBw2hLUMtLU481PxrOmlSNWwS+t8hHw=; b=FmH8Mu9Y5vAHC3tsnVF2eOeEHybGQzFPYjcdPIEwX32vOGyLA4nJ4UTonXdC6YMts9 aLkHWeXi30ImsHqJPxS1sPaoXe1Jfmuybs3PqFDCMT/vMoa3Y7h7PK5sHzzRj8xaXPJe hq95sK1wKAP1eZ5/t0aczLDoFL5nYFJpc9Y9FfYDDTxzNxH3wkxW5clm3dz0UA68GuAv +9YkI922HYuDhl5QVeAqzsvjiJT6jdboYER6KVagiQ5S0FSAN9xD6boVzOziEZzhTpWi Px/F4AHH8/OPfUuXDseFbFhcCFig3TVDEvbOtqCUZc5q2WWtPg6nyBIocxfthhq7xOND 44/A== 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=oto3ZKEBO7uNTBw2hLUMtLU481PxrOmlSNWwS+t8hHw=; b=lhH6lbWqv8FvEIvaTeSoXLqKB4+PAkAqf61IYKvDCcjcqldXmoDxKV2DL2xykAC+nc Ue2xHujBuK0SaEM5wny++qnQ4ZZDljVHYqZJK+a9aKJkTEEkI+DpmOvmT/WTg+3Te857 PNNVfJKBQSahFyvVx3Cm9ODzsGyhU+KLrJpSC+Y30AL/70Bkd/gPlDBXHhUOkM96k3+n W/100BGYPuv1zhxhnxwc5zu0kZWsz8agITf+m+mbnGQEbusxOdGfb6DaSHyBKcb0VYcl kp4/AXuOr61T+fLS5t6pQgN/BTZVIYuQ8/w1kALNqgEPoFtFaqgexFsJFqZClDxMjpVx mvVg== X-Gm-Message-State: APjAAAU0XF+j6wSSUjp2macvEAltHGku81pVhIXU3AWpLo5XmcjlrIGu LaIm17zaVN07UIGCicixW6w= X-Google-Smtp-Source: APXvYqyP+aKWOpZc9wPTPESqYu90m/fOpcXXAVg3c5T/FoSA0Uyt5SPFiSS93ZR71XVNjYJjv8CFjg== X-Received: by 2002:ac2:465e:: with SMTP id s30mr9546033lfo.19.1563526091674; Fri, 19 Jul 2019 01:48:11 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id s21sm5588742ljm.28.2019.07.19.01.48.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Jul 2019 01:48:11 -0700 (PDT) From: Sergey Organov To: linux-serial@vger.kernel.org Subject: [PATCH v4 0/3] serial: imx: fix RTS and RTS/CTS handling Date: Fri, 19 Jul 2019 11:47:51 +0300 Message-Id: <1563526074-20399-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-20190719_014813_821767_B3C325AB X-CRM114-Status: GOOD ( 10.20 ) 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 This is rebase of v3 on top of 'tty-next', to get rid of commits that are already adopted to mainline. 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: v4: * rebased on top of 'tty-next', to get rid of commits that are already adopted to mainline. v3: * 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 (3): 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 | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) --- 2.10.0.1.g57b01a3