Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3110132pxm; Mon, 28 Feb 2022 12:12:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzdbu6ovhrpJ4PVSTjegiNbY6EHs8lCTxcb9r7KCi57eerOgVb71+diAyz8ITvrffWcXKiD X-Received: by 2002:a17:902:7606:b0:151:6e0f:8986 with SMTP id k6-20020a170902760600b001516e0f8986mr5301045pll.20.1646079171646; Mon, 28 Feb 2022 12:12:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646079171; cv=none; d=google.com; s=arc-20160816; b=MmrJrI/vn8t9ydZVANY+JPPeTUQSJMWXl4ZcIQEiLMbPu/Zru4GKLhvo40Uy93/VCb U3NXs9aXXeRy/wTg1X0vNdY9nyIMFIZTo5yZvg+8ftskvvhrplQEQaYJ5gkmKilN5Fq/ vtP03OkPs2HAq4AtbBNBb7+odKU/xSvFRebagNRWB2OkN3KIN1jK7I8WRzClb3herDpL xFwh567opWY0UYXRzqHbsk/n2c40IqPH7fGZd7X/QCXyJgInlhX67kSMYjyDci4vy6dk gvlUJhW2RDMq3qT06DUa6SVzYZJcSyK63Yx1kdoonb4YghMGfcbjnLQwDF6yyxwBQ35C IOZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MNzLpl80m5hohilkXaJGFq+SeUnFmVteD25FaYr//ZI=; b=ppvQEiE/SXsZaALYo8vxRuL2lpbzZcqXH5Zslk1La581Wp3sISJFE8/CIleYkKQ1bz leBd/DvVuROGTn0lqrWR4nW8MKbeAP8cHpThnq2lnMpzNhO0xjoRI4J6lNRKSp3INElI k815Bqj62rPwGbmkUfskCFiluhYK5rJnjWxPl4+EqfPxcEqn3WmlUqRjElGn9UJujOEj cSMms1YfMatH2YOynZMyPpf2bQmK3JSCfNxanlX2Do03zIw2RANENuua1LrjAoEcqSYq w0Oa+stTSxUpcO6nqUvdaBdgP63EQFpABJk0wGXUnWpb5klrNZV6CNfw3oAQdrXYYLV5 CbNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SsJ5PWI4; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e3-20020a170902ed8300b001501d25069bsi9322764plj.239.2022.02.28.12.12.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:12:51 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SsJ5PWI4; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2DC0E15AF0F; Mon, 28 Feb 2022 11:35:48 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239631AbiB1R62 (ORCPT + 99 others); Mon, 28 Feb 2022 12:58:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240543AbiB1RyX (ORCPT ); Mon, 28 Feb 2022 12:54:23 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 098A789309; Mon, 28 Feb 2022 09:42:27 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8AF5F614CC; Mon, 28 Feb 2022 17:42:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0CB6C340E7; Mon, 28 Feb 2022 17:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646070146; bh=ZNL+mEBR4XMCq4oZHwhquU3SqBWtFw4lFumbGLpqAdE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SsJ5PWI4FD6UrDmEeOMxYUZ+NWODlu+NR/TaxnOise9jPt5jL+PrDkY9eFwiDVI/v RJWE1jMxgfiyOQtTttfCjAIewXKa4OzRFxmECCfHl7xAn+tnobfYzTcRQa8MHl5ufd fmP3+8F6HHcxA2186SNL9kJ8CMPh/UFyfI6BxfnM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Starke Subject: [PATCH 5.15 131/139] tty: n_gsm: fix wrong tty control line for flow control Date: Mon, 28 Feb 2022 18:25:05 +0100 Message-Id: <20220228172401.455830521@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220228172347.614588246@linuxfoundation.org> References: <20220228172347.614588246@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,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 From: daniel.starke@siemens.com commit c19d93542a6081577e6da9bf5e887979c72e80c1 upstream. 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 Link: https://lore.kernel.org/r/20220218073123.2121-5-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/n_gsm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -3180,9 +3180,9 @@ static void gsmtty_throttle(struct tty_s 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); } @@ -3192,9 +3192,9 @@ static void gsmtty_unthrottle(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); }