From patchwork Mon Jul 22 19:22:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 11053335 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 8721314F6 for ; Mon, 22 Jul 2019 19:22:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 792D02837D for ; Mon, 22 Jul 2019 19:22:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CC4128508; Mon, 22 Jul 2019 19:22:41 +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 E07AE2837D for ; Mon, 22 Jul 2019 19:22:40 +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=D1GlJVkFUHVsL7e3wF9NCq6Z28WtxuHNgfJN7pO6Um8=; b=tWAjzBTFC5KJfJ Gwu7teRV3LLC476qbB0+qzncdhY26+XHjJEMxPrlEHNu4eo8nreOnUGoX+lnVIPGLbjSOk2iDNy1W 1Xf4AYOZFvq/QBFnoaXV624kAEiSC8v39ZlqntWznUm+/RnFS4CchkN8rjxN37jm9H/WmHrq5L6Co tq6aSq4RvTwyeG/e76eMg+kyZMYcvVMHWw4dyM4wwnYAeycR/tBhyAVQQWXlhrPMgQXHDAuE9XXph kbOC8fThb/pq8AMv3slgHzrQKxOLVtZkE9cQp08Vbg2paRUpQ0u0FuYT5P+C/6R4lH3Y1urmz5gPw 32RlCTPY5Z72eul813BQ==; 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 1hpdtD-0000Ar-6N; Mon, 22 Jul 2019 19:22:27 +0000 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hpdt8-00009J-Kq for linux-arm-kernel@lists.infradead.org; Mon, 22 Jul 2019 19:22:24 +0000 Received: by mail-lf1-x143.google.com with SMTP id z15so23204162lfh.13 for ; Mon, 22 Jul 2019 12: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=B+wLTNf/Uwskbq5M303aynV2tJy9ox88Qjj+ByJiaYE=; b=ANdHlqKbTdBYHjMAbE0HYGNKESqdyGrOqyoFguo2nHCiTzNm+nSOlTB75vmGn9lM7o C0AMP0scdDw1qesdwa02ykA8zCk+pNWn00vz/h6ULYYZcQ43hGZe2JSH5l5FHPO/I1mT A3VSyqcnvlJ5rB/UfF1mGYDuIOHON/Xcmt3zFJ8bfZrqXJKrBYT610UeOHiW9ny7wHoz iTWdtLGn/EuXcwoYYXlJft8KbQjNhuq+iTGRGL3bpMlcOkIkwoxwX91vShcMjgzqWqk1 MJlDIT07H+6EY1iF1KxhnA80tGNjUIluTF62/Rs8GIokuuwPcjmbnUdmvhr3IwhjQV8Q WVfA== 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=B+wLTNf/Uwskbq5M303aynV2tJy9ox88Qjj+ByJiaYE=; b=hSSOLhpNMtooCBETV8yNdx9JmBpp1QMDO5YzPKI847FlzL6c1kJysMSCfbx2lNKbqU TD2GS8QLRew/dDPrkO1Ng/+dRVNtESlMeoagmYvq3HCYBIRmrdsDJ8ijBNMqPYx+tBT8 gvB9LLHi4OtR/lH50BHUa4n/jipxl9ph/IZqgZoTQZTVN8DNoje907dM156lCiAZWMvv KvOKukLYYyAUhdbv7hOl8xDD+bLevdFsusaKnjVmyYW7TY8pnhOlKtQ1IceoVdSiPfCD 9E116ttYquCf6B++2P4GJ8U9pq4DBgg/XdKYcrUKIOYONjEg97Tp2MsZXM5h7EqLq2tS H+QA== X-Gm-Message-State: APjAAAX0BaG1QAZ72p+GO/j4FdwMfzn8JDHhFV0hB+lIuJhuKFQf/u/Z RZ+Dz42N7CjJSztkIgVxZyE= X-Google-Smtp-Source: APXvYqxybz96lY/OxtuFHly5X1VQ1wXpABYlNEv5AuhHbT96ydrSIk0EcBLs+DyXCOunCA9cPFhX6A== X-Received: by 2002:a19:f819:: with SMTP id a25mr34288851lff.183.1563823340126; Mon, 22 Jul 2019 12:22:20 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id n124sm6129307lfd.46.2019.07.22.12.22.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Jul 2019 12:22:19 -0700 (PDT) From: Sergey Organov To: linux-serial@vger.kernel.org Subject: [PATCH v6 0/3] serial: imx: fix RTS and RTS/CTS handling Date: Mon, 22 Jul 2019 22:22:08 +0300 Message-Id: <1563823331-5629-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_122222_718165_6E87F2DE X-CRM114-Status: GOOD ( 10.14 ) 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: v6: * changed "Reviewed-by:" Uwe Kleine-König to "Acked-by:" him, according to his request 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 | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-)