From patchwork Mon Jul 22 09:22:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 11051857 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 282D46C5 for ; Mon, 22 Jul 2019 09:22:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1202B2847B for ; Mon, 22 Jul 2019 09:22:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 024E628514; Mon, 22 Jul 2019 09:22:27 +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 50C3D2847B for ; Mon, 22 Jul 2019 09:22:27 +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=5UkgtY9MAQ4jeqezepyqmmr/oy+yYGnBVB7AmNZPW2Y=; b=OLO8MygB2IdTw/ rxeGPCfP/qGsBXJRHS+Iu6rPJolSznLmmmVvnKwdcckcjwJwce3G7Xhvtc0fYa7XH+izv3tY001Xc 1abRkYuGlAFmT0Roia7wylhxN5dSXqq77XcT0tGUtMHEUh+eeTwwqXagG1LF/bDS+L2CcXpa5nODh v/ICHubgichZeTpk2XixrcW+1iqKYYMqjDBeawuHFDawJyw/U/CeYLvBCHv7KE/0aYX2K2HtSdk1x rUJH9qP8O/AcfvCUoSRRAXuI+3nQnUwJ2QFgTojduDqSGDBTZHKptr9BccpUJUt2QkZhCP9lHqL/s L4JYDAZQ3Gunuhrf862Q==; 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 1hpUWY-0005fQ-Q4; Mon, 22 Jul 2019 09:22:26 +0000 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hpUWT-0005Tb-Pb for linux-arm-kernel@lists.infradead.org; Mon, 22 Jul 2019 09:22:23 +0000 Received: by mail-lj1-x242.google.com with SMTP id m23so36808624lje.12 for ; Mon, 22 Jul 2019 02:22:21 -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=lrWYZGqJXzSxKADpLuyahH23cD3MUUQeJThT2mI2Whc=; b=depTRLXJ/ZmYHWhXEMVfUAAryrh6TYc+k7bN9TkX3l0j7uKhu0wKRH4ZK6BDbimDPt I5eu3yyL04yoaAH8Y8jOkcqszxrfAZtHM+rtui7QOHWbJQ+JHXU79RTlR1LZVxoNCXWa wrVaqnu25zkGwC/762zdYlPadRxWNMyHBKUwCVULp7g5j9whk/r0gTyff7tuqAnlpFKC wpvcHLyL1vIT0S1gbDRvQCtLEEDTVCfHXflx57E/+Ck8nj2wiwjXBLhBSlk7lxGYTRyg N/yeTNXx+cnNK7KqwOxeXhiR++6HLEy+xcuWGrXVj76DxKJV/4qEh8l/G598Y+LlPwWT y68A== 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=lrWYZGqJXzSxKADpLuyahH23cD3MUUQeJThT2mI2Whc=; b=YeB5CGqB4EIevq5TrntTKxrsxy9j+xqSfUtM1/MAUh+7dcI9o8GJLGHHSacmeyR2Bj qOQ1vPw3I1sxiz/BnOpp4SCAk+4O9LLHNxv8dffPNOo3N0qgEn8/mqhZMffg0vUt7ypV t9cUf8iD/TNYwOVuqFSwhDT7xII2wuPYdqloZlq/uLEiFFUaB9zIXlPgMNMryg8ey/A+ qF3Cr2C1ack4v3d0zXkLAmLNzpnnhaaH0JFwCUatcW8bbzB6JBxYjCQH1eiUix03wx6l nfMPu+UPSS0PqlViwAKWoiDourLiTJ0ONm9cyjcSEGM6dZyi+RuiJID23tPNuh/CYoVF 2MEw== X-Gm-Message-State: APjAAAVo61q6DdGAnG92z5BHtkyOLBF21TpyWtYnKVeQBhtQI3p6o3Uv qXapH6/wmjJs8CEmlxl8WOs= X-Google-Smtp-Source: APXvYqwPyJK2i33PLD/7pimqBkGh9JZClfOytaE32uS94uzJXSr83ogFfrmup5Kx18y0Vl75SV7hqg== X-Received: by 2002:a2e:8847:: with SMTP id z7mr35982100ljj.51.1563787340123; Mon, 22 Jul 2019 02:22:20 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id b68sm8425088ljb.0.2019.07.22.02.22.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Jul 2019 02:22:19 -0700 (PDT) From: Sergey Organov To: linux-serial@vger.kernel.org Subject: [PATCH v5 0/3] serial: imx: fix RTS and RTS/CTS handling Date: Mon, 22 Jul 2019 12:22:07 +0300 Message-Id: <1563787330-1394-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-20190722_022221_855739_EBA3E618 X-CRM114-Status: GOOD ( 10.41 ) 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: v5: * improved commit description and added more comments for "serial: imx: set_termios(): do not enable autoRTS if RTS is unset" as suggested by Uwe Kleine-König and added corresponding "Reviewed-by:" 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