Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2876835rwb; Mon, 15 Aug 2022 13:07:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR52CncK3njUz90S4kSOPQq1YBoYF88gYj9LOUZCXx3LPiB+3Avj2angFotPJrC/Mnvy3LSa X-Received: by 2002:a17:906:8a53:b0:730:b81c:138 with SMTP id gx19-20020a1709068a5300b00730b81c0138mr11241510ejc.114.1660594058664; Mon, 15 Aug 2022 13:07:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594058; cv=none; d=google.com; s=arc-20160816; b=ddQ2bjcR1HV/yqR5ZJO6jXthf9DzPeqLvpJUXcgLxJfmeoRVUGuPHoBmpxx3vjmVqM ePAyhgpxwjFII4qK0nWwT+liIUcvbi3blRoQS2XuL2nAeKmpkviCZbhHZ1HVlIpZWx9i mGVYe5P+qlRn1IOmyDfSiZxtI1Z9elJj7jZXcqJwmufW/c93IQaemLTWmJhmNVVTlFP/ +mzCmR8C3oMCHGW7p+Ci/IXNR5hW7ns9urbAGNsMHDa6Xz7UKbx/J4VXWb1Zfkb7aDmo Sz4YRMhtG5oqXbj07Py2zesQhJ8OTTIXomGmMBlzjtnrgS/4IWbPumnvX/x0KkdAW4gx b59w== 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=tMRZI1GlXf4c17Iu5hVpa37G3eU5abWeGR3D1BJpJFk=; b=NO06XH0WZ5o8B6vz+p4ogR7MxCCQEhWXm2pgx4QT7ObeniNaZaV2DCN0Ux91BdA0Ag yq+P/4Z14b41seiwXwHHSP8FUlHAz39UF8Hys/IyvlERlNeg6u4c0CrLI1v9kGBB1sBk BfXZVgzYNe9jIor41s++EkzopeZ3Ra6odTLdKoPfroGWd2fURULGqyT4n/jJbHoso3f/ qd9TI4AYx2NY7eVEyVpMmILJIQyd87iIWtsXh+idElFd5QQrnQ4kUnn3wqdVH60g5EMv Ry+JGjn+VF/ZC/U+64QKARgEgPCWiR/yX7EDUZRPbSGl7SrYo117qfdxdd5ZMc5sE4lc MeRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bJrzIRNz; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w21-20020a170906131500b00731684cfd2asi6878842ejb.875.2022.08.15.13.07.12; Mon, 15 Aug 2022 13:07:38 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=bJrzIRNz; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245569AbiHOTdu (ORCPT + 99 others); Mon, 15 Aug 2022 15:33:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344978AbiHOT1d (ORCPT ); Mon, 15 Aug 2022 15:27:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D39EE5B7B4; Mon, 15 Aug 2022 11:43:23 -0700 (PDT) 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 A04DA61029; Mon, 15 Aug 2022 18:43:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0BB3C433D6; Mon, 15 Aug 2022 18:43:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589002; bh=AhmeuQUzMoaGbxiUtk8bPJmXxcVzqBhuEkgrIDVu3A4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bJrzIRNzRXO4PkKaQoSBejKgIh1jdXT1SxBNMbmM7b7i1jnEA45t3JTrTU4407V/7 X8iiKRpnA2aKcS/R5TNQVVJVfJvhH4D+XFeygyzk5y6IZsWrzEI+FdCFH1GtD1/JpF tYbVyu1DRZGdYxPSscBy+xX1FX0xMOKNFSFbz1D0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhenguo Zhao , Sasha Levin Subject: [PATCH 5.15 582/779] tty: n_gsm: Delete gsmtty open SABM frame when config requester Date: Mon, 15 Aug 2022 20:03:46 +0200 Message-Id: <20220815180402.212451203@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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: Zhenguo Zhao [ Upstream commit cbff2b32516881bef30bbebf413d1b49495bab1d ] When n_gsm config "initiator=0",as requester ,it doesn't need to send SABM frame data during gsmtty open. Example,when gsmtty open,it will send SABM frame.for initiator,it maybe not want to receive the frame. [ 88.410426] c1 gsmld_output: 00000000: f9 07 3f 01 de f9 [ 88.420839] c1 --> 1) R: SABM(F) Signed-off-by: Zhenguo Zhao Link: https://lore.kernel.org/r/1629461872-26965-6-git-send-email-zhenguo6858@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/n_gsm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 4946a241e323..f86c5ebfcf91 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -3214,6 +3214,7 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp) { struct gsm_dlci *dlci = tty->driver_data; struct tty_port *port = &dlci->port; + struct gsm_mux *gsm = dlci->gsm; port->count++; tty_port_tty_set(port, tty); @@ -3223,7 +3224,8 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp) a DM straight back. This is ok as that will have caused a hangup */ tty_port_set_initialized(port, 1); /* Start sending off SABM messages */ - gsm_dlci_begin_open(dlci); + if (gsm->initiator) + gsm_dlci_begin_open(dlci); /* And wait for virtual carrier */ return tty_port_block_til_ready(port, tty, filp); } -- 2.35.1