Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1081832pxb; Thu, 17 Feb 2022 23:42:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJynyWM12RfxPLN8L/dTEE/B3Szujkrsua4A0L+n0lVedU46NFnhbtlviwERh+xoq1MzP5XZ X-Received: by 2002:a17:903:1cb:b0:14f:19e4:a0b1 with SMTP id e11-20020a17090301cb00b0014f19e4a0b1mr6343922plh.141.1645170123884; Thu, 17 Feb 2022 23:42:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645170123; cv=none; d=google.com; s=arc-20160816; b=RLEbDDz27wRaKBGMO8/tjP0KDzx+Orp43t/pwl1EuwfMH1iP/RxNnLwV/7hZEWOsrP 2wjUhpa+es805HImWxCwy01xFkFh/J0LGCw2uYTJuAFbmwq9yC7NVxyPqDH7GuCRLF1G o6pC7284Ec82ZaLIApa3baVs0cXzpPoXKJpi2UXPN6cOD3LBL+FZlgxgLKrKVjljuFch CDX4+/nj3HONbbvb8TQSrQOVXezHzZPPAooQZivWLk8/aS4oYrKnI9ZDas3vDSlEG2DH NTnNVIhqIWXzvFfYiPf1DaIg1EsPZHxjAK3Y6zGlU1Grip4UEH76XggdJJf8OtT/wW8K C0rg== 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=pQxMAl1P7C8IrYej1JTJeL4TN5EC2UB8A+uUQro6e3vXfs8KhZE/Je5Gx9ATL/XlNi uVhA4Umu+tF3LxKcBqWWBPK/FbU3IKOH/Q/LQ6CETrF0Vdln7m7S1+Pl0SSuudMC+imZ Vy1rcg09ddv4Y1NslOV8FoExQKmTKV55zvPaEd2wKikofSI2If+mEDYPrxl8txhpnvac WVCJ16JlB1ogxzRVekjR1cirnX2K9dDMRzWEg7Yw08QmBGyjWhXndc4p/kf0fIXzPJp4 oee0z37ESsItGm2LU52Yh/sA1wYenWzJcQ1UtUDjAKaY1EkvaaHYKZ+n0DblpDQZcB9b U/IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b="Ae/DZ3+U"; 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 f13si1787182pfv.190.2022.02.17.23.41.48; Thu, 17 Feb 2022 23:42:03 -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="Ae/DZ3+U"; 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 S232157AbiBRHdQ (ORCPT + 99 others); Fri, 18 Feb 2022 02:33:16 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232043AbiBRHdA (ORCPT ); Fri, 18 Feb 2022 02:33:00 -0500 X-Greylist: delayed 65 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 17 Feb 2022 23:32:39 PST Received: from mta-65-225.siemens.flowmailer.net (mta-65-225.siemens.flowmailer.net [185.136.65.225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7DDE298AF5 for ; Thu, 17 Feb 2022 23:32:39 -0800 (PST) Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 20220218073129d2fd45c0dbd12ddb45 for ; Fri, 18 Feb 2022 08:31:30 +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=Ae/DZ3+UHcKVxrmVq1qvNV8D+x0fgpLMcm+JgnLDH54btnf8vLWHoh6JFSLZL0VNzpSdfE 9GRk4tuZRfpnjB33+zTDS5iazKPly9SOE2xHJ90wKAp+tcKDpdgOiOJX6uws4Uv3hhyQCIVy OGUtFV7998khpjYBL8mhtGpJHszbA=; 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 5/7] tty: n_gsm: fix wrong tty control line for flow control Date: Thu, 17 Feb 2022 23:31:21 -0800 Message-Id: <20220218073123.2121-5-daniel.starke@siemens.com> In-Reply-To: <20220218073123.2121-1-daniel.starke@siemens.com> References: <20220218073123.2121-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