Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp554420pxb; Thu, 17 Feb 2022 09:33:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxWNLbRS5P2ZnG9tRPbXKQeeqoimNfPCm5o2ccuu7xUXNvpsfuFbKa6Y+W71kXkmKmLJjw X-Received: by 2002:a05:6402:40c9:b0:40f:9397:a2a0 with SMTP id z9-20020a05640240c900b0040f9397a2a0mr3745207edb.249.1645119219904; Thu, 17 Feb 2022 09:33:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645119219; cv=none; d=google.com; s=arc-20160816; b=gtdizMKxvB5q31BR4pZcZjv8h19707/+UkHBdNQGnGmhP7C3gMS2MoDipB8lxJtwkG 5VhmeY/MdmurK+TGvLdphh5DPvrAjwnCfBDYtNE68R0DBunQQA3U0dWjwS8dkTB1pOj7 ZhC7GZ+TKJQcUzgxqmktI6FV7Ll3C3e7vhmxNLmGzj1aUYzSuwkKkO58Zwlxban9SG8I wzKBogAtHzlSnRa0V3w5zOM/UTjS64FzWGFOmjKXvSrxViLgbWvZpKwlKHLnv6mCcISR oTeIAXspi4YasmmkBnmTpyvgkWjYaMM7t+d+isrMj5zb5/3yDrgUwmMzDvQtlXsXoEKn 8oCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JtVIeHCB9L76k6Yw2M8lDa9b0zL37qXi5FJsmRZz2WU=; b=ZaTXMmLluhZzXA+27zHMk+OKpG42R2wRlBKLQLAdfBG4cBQZ6G2UIwtXgH3aORownC E9wymnbqAyAw7b1t13G7U6ohJnugDGrqbXwNoY9t0IqwJi+sgfYqlICUOTpe/F3bX5p1 Uq+h5tinQ3FUQAF5c+G2L8xTmZnhIrNq8cxdHdTJSQxn3jWY7+L9gDIxA2fgJh6K8a62 5YBfOT5miHmjPzsGkPWRCQQqhaUXYO65n+qQ2eXz5YNeo3bpfi9+QPdHl4CkK2VwUnBV Jo0a2FY3uT9xQHj9ekBvv6zwXV16r4H8dlfuU9c8mwSaTOR7jjF7H5wt9eBa+PpePrM5 8vzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=eS51mI3J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ht13si2238052ejc.345.2022.02.17.09.33.16; Thu, 17 Feb 2022 09:33:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=eS51mI3J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234964AbiBQIHk (ORCPT + 99 others); Thu, 17 Feb 2022 03:07:40 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:45704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236653AbiBQIHV (ORCPT ); Thu, 17 Feb 2022 03:07:21 -0500 X-Greylist: delayed 62 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 17 Feb 2022 00:07:07 PST Received: from mta-64-225.siemens.flowmailer.net (mta-64-225.siemens.flowmailer.net [185.136.64.225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DD8027DF3B for ; Thu, 17 Feb 2022 00:07:06 -0800 (PST) Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 2022021708060067a499c5a760468eb0 for ; Thu, 17 Feb 2022 09:06:00 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=daniel.starke@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=JtVIeHCB9L76k6Yw2M8lDa9b0zL37qXi5FJsmRZz2WU=; b=eS51mI3JUxfQusE0dUEN5VFVMQYo4B+NmA9pAriBxRfYnUqczBraHgH+huGowZJlimxsVM sYij+KNfO7Xuc0iq16dBqKtx9/C+QcbefBsSy6atb3PYb0McpLdmse1BJ7H0z7PBY0MG/5pA GeQ7ehL7sHJto8GsrOuWa2dBRlF54=; From: daniel.starke@siemens.com To: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-kernel@vger.kernel.org, Daniel Starke Subject: [PATCH 1/1] tty: n_gsm: fix wrong tty control line for flow control Date: Thu, 17 Feb 2022 00:05:53 -0800 Message-Id: <20220217080555.5387-5-daniel.starke@siemens.com> In-Reply-To: <20220217080555.5387-1-daniel.starke@siemens.com> References: <20220217080555.5387-1-daniel.starke@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-7517:519-21489:flowmailer X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org tty flow control is handled via gsmtty_throttle() and gsmtty_unthrottle(). Both functions propagate the outgoing hardware flow control state to the remote side via MSC (modem status command) frames. The local state is taken from the RTS (ready to send) flag of the tty. However, RTS gets mapped to DTR (data terminal ready), which is wrong. This patch corrects this by mapping RTS to RTS. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke --- drivers/tty/n_gsm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 0b1808e3a912..d57fd055b489 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -3234,9 +3234,9 @@ static void gsmtty_throttle(struct tty_struct *tty) if (dlci->state == DLCI_CLOSED) return; if (C_CRTSCTS(tty)) - dlci->modem_tx &= ~TIOCM_DTR; + dlci->modem_tx &= ~TIOCM_RTS; dlci->throttled = true; - /* Send an MSC with DTR cleared */ + /* Send an MSC with RTS cleared */ gsmtty_modem_update(dlci, 0); } @@ -3246,9 +3246,9 @@ static void gsmtty_unthrottle(struct tty_struct *tty) if (dlci->state == DLCI_CLOSED) return; if (C_CRTSCTS(tty)) - dlci->modem_tx |= TIOCM_DTR; + dlci->modem_tx |= TIOCM_RTS; dlci->throttled = false; - /* Send an MSC with DTR set */ + /* Send an MSC with RTS set */ gsmtty_modem_update(dlci, 0); } -- 2.25.1