Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3013103pxm; Mon, 28 Feb 2022 10:15:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+5N86G0uSAR2pE7JdgeZH+tyB+Qhjwwt4xjTLYHoRcOyNqZY9sgAIukTsyGz6vP9Bl44t X-Received: by 2002:a05:6402:d5a:b0:413:2db4:b4ad with SMTP id ec26-20020a0564020d5a00b004132db4b4admr21002256edb.287.1646072147829; Mon, 28 Feb 2022 10:15:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646072147; cv=none; d=google.com; s=arc-20160816; b=w5dkG5erNqZ3WDGdL5NLRIxQ6hWVfSE4bS1XcG6w91hNjb7zO9pYUK9CBonYNyKKok FT7Tgn767LlWTp5FLsNoeiHCmrhVaJyyzSgGmxbExWwl0RXDz/8ZSgXRMK6dT/MHioXo K9/SkzODvXiVRtjzutOadegLUx6lJhGKBpQEtzx2blUf06X/5TGEM3pwDsaE2Eiuwgir lZ9TsD0G8st4pHme9OYucllar1L/XE9GX/ZJCGiHK8BZKB/6VobOqZKmtlTF7QIx0EqM tUAP2iOsgXsI3XnklLfha9MEAyNuE08e7N8mBVD9HteaColX2SCb3pgQF00SpjfZMR+e ZFZg== 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=L/xD56ygfEd2Db/qmjfBt4/8SUhU+89is39z4763CA4=; b=Com6i4Ho/PEDDgy0W7gEbLmmJhnaVu/p8TORuuBL7yb79BqaUONH/zFTjveF2bOqZb 53WjfFKKg9Qbi2Iny/V2E8rf5BdWykTfvKQhfAB8HEsxV/bIpaoPxQ+CDTRYDsy29dVl orAEZqtU+qBPMvVRSW1LLQdAiyGf0chu9Jtrm5aY3ZljCDc0EHBOVMRC8PnsEb8GS+tC BIDnGaPHGleS7zv+OeX4haNf5LRZYzCtv1N+PZMG5/ssDRmhTnWCXwF2PZEKrk1g4AYQ gHZZhypc3q7RBYctZ7g8hZCmqg36n0YAQXHQmgoA0M3Ygv/edrvnCM5LXzjd9Qr0mKLS LaYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1BYEKe33; 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 l15-20020a1709061c4f00b006d03c19857fsi6564868ejg.725.2022.02.28.10.15.25; Mon, 28 Feb 2022 10:15:47 -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=@linuxfoundation.org header.s=korg header.b=1BYEKe33; 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 S234226AbiB1R3m (ORCPT + 99 others); Mon, 28 Feb 2022 12:29:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235540AbiB1R1t (ORCPT ); Mon, 28 Feb 2022 12:27:49 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 494F388B3C; Mon, 28 Feb 2022 09:26:53 -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 CD82561359; Mon, 28 Feb 2022 17:26:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE168C340E7; Mon, 28 Feb 2022 17:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646069212; bh=ME5hYI9dA5CJMdTQviur9WnfT8yjCYRmFBcC3IX9d6s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1BYEKe33jtOb5qDPFGAuWXN6kmJaW9ERwxc2wJyGEoycE9Gpd4Cv9p8q+CNuTMI0f gQLJnxr/DmM8dDPqCUd1VVdFthK4L6Rh55NYIDKUlshiPKhMhEkdVvhfFxiy4rK1+m n1ikd4dJXsd2uW5ni5mK2yfdlp+Bl3LiAcHZQ7h4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Starke Subject: [PATCH 4.9 26/29] tty: n_gsm: fix encoding of control signal octet bit DV Date: Mon, 28 Feb 2022 18:23:53 +0100 Message-Id: <20220228172144.329264359@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220228172141.744228435@linuxfoundation.org> References: <20220228172141.744228435@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=-7.5 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: daniel.starke@siemens.com commit 737b0ef3be6b319d6c1fd64193d1603311969326 upstream. n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010. See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516 The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to the newer 27.010 here. Chapter 5.4.6.3.7 describes the encoding of the control signal octet used by the MSC (modem status command). The same encoding is also used in convergence layer type 2 as described in chapter 5.5.2. Table 7 and 24 both require the DV (data valid) bit to be set 1 for outgoing control signal octets sent by the DTE (data terminal equipment), i.e. for the initiator side. Currently, the DV bit is only set if CD (carrier detect) is on, regardless of the side. This patch fixes this behavior by setting the DV bit on the initiator side unconditionally. 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-1-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/n_gsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -444,7 +444,7 @@ static u8 gsm_encode_modem(const struct modembits |= MDM_RTR; if (dlci->modem_tx & TIOCM_RI) modembits |= MDM_IC; - if (dlci->modem_tx & TIOCM_CD) + if (dlci->modem_tx & TIOCM_CD || dlci->gsm->initiator) modembits |= MDM_DV; return modembits; }