Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1632834pxb; Thu, 14 Apr 2022 10:26:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbEYqJI4X6kTQ6lcasFwexW4xvX+MFqMmsuuEpyCKdWQs5cgDv+58wLJ8gzR76pUzlXfNO X-Received: by 2002:a17:906:5d0f:b0:6eb:8bdc:7406 with SMTP id g15-20020a1709065d0f00b006eb8bdc7406mr2906751ejt.707.1649957182391; Thu, 14 Apr 2022 10:26:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649957182; cv=none; d=google.com; s=arc-20160816; b=PN6VqfZ6yPi4JGyml9/LJbB82n0bT+uBmccxxyuoqZzNS/YXKxbjNiaKnfKCjDjMlK ELpgZ3MlkPSoDfHc5YktYr61iVDXQYD+mo68AxdrTH2KEnrtOCo/Bk6/acm3vkHSfaMH 4Dpts82d7ZD/wI5wky+bLe+rsFd7ukDHhoD9fn+VdnwaR084IQ2Z6Z7oVzGX140p/u03 0U2rANfOluRWIdNxUjmTcoGnhGJsY1JyAi0RNONNJz4TFp5ho+O8shX+nqn8kUDog+DD 3F6ZauPm5YSXg09ZY/ZFIBV8mw9kmQUSATJjK/rDLQy/hS77rGMllcnirinKt5cDdZVl cuIQ== 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=gdfAGgzM4Vi58pSdh4MbItUru99n9GvLAnYuaYt30SY=; b=Tw6e4mqky3i1ljbFTW7vZ1smaGinK/awZxfCxjlHSkBhgrEk6bb2vA6pz+MQz8UvXF VNoeD9O8Tr4hhOCzGjyN/q53MI1qQ/0etgsInEaXw7URgLq2Ew0dctAcZLUBsbk/yru6 Okdf3Xtmv7MIVkmLzGgrhXtPwLeLimLYlcG5y7bwh8DitHzK4wSc4IK4+UrQ4Mb8Livn X5gnMldODNPenntB68Kb3r2VVvN3xJt/iRoAiv1rifkEEDoY0A07zrN6czX8M0fbCTQP JOAlJPppjnGHkGhPtf1XK93VkEhZL+75PhmYUrTQfWjd53wdCTnPRLgjH0250lBJhNoP GBYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=HsXV0ea2; 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 b23-20020a170906709700b006e8746614ccsi2314183ejk.717.2022.04.14.10.25.54; Thu, 14 Apr 2022 10:26:22 -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=@siemens.com header.s=fm1 header.b=HsXV0ea2; 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 S237474AbiDNJr2 (ORCPT + 99 others); Thu, 14 Apr 2022 05:47:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241932AbiDNJqY (ORCPT ); Thu, 14 Apr 2022 05:46:24 -0400 X-Greylist: delayed 61 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 14 Apr 2022 02:43:58 PDT 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 77CB370CD9 for ; Thu, 14 Apr 2022 02:43:58 -0700 (PDT) Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 2022041409425028f005c46ec1be9227 for ; Thu, 14 Apr 2022 11:42:56 +0200 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=gdfAGgzM4Vi58pSdh4MbItUru99n9GvLAnYuaYt30SY=; b=HsXV0ea2EUSzL0jX6rgpIyUY2i2lDk+uBDa2Dt0ZLcTmPYNJX6WR48GLN2EDDJpzxL09t5 1DN4+LVtAAAhWOSlsJgwp6Qlr8y00i+qSu9D5loiiqjT9BctaNFm1zjK2n/DzKYZNF2vv652 AXddmWlaV9/5lc0VJcT2qfmw1fFeQ=; From: "D. Starke" To: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-kernel@vger.kernel.org, Daniel Starke Subject: [PATCH 15/20] tty: n_gsm: fix missing update of modem controls after DLCI open Date: Thu, 14 Apr 2022 02:42:20 -0700 Message-Id: <20220414094225.4527-15-daniel.starke@siemens.com> In-Reply-To: <20220414094225.4527-1-daniel.starke@siemens.com> References: <20220414094225.4527-1-daniel.starke@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-314044: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_MSPIKE_H5, RCVD_IN_MSPIKE_WL,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 Currently the peer is not informed about the initial state of the modem control lines after a new DLCI has been opened. Fix this by sending the initial modem control line states after DLCI open. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke --- drivers/tty/n_gsm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index f3fb66be8513..e9a7d9483c1f 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -369,7 +369,11 @@ static const u8 gsm_fcs8[256] = { #define INIT_FCS 0xFF #define GOOD_FCS 0xCF +/* + * Prototypes + */ static int gsmld_output(struct gsm_mux *gsm, u8 *data, int len); +static int gsmtty_modem_update(struct gsm_dlci *dlci, u8 brk); /** * gsm_fcs_add - update FCS @@ -1479,6 +1483,8 @@ static void gsm_dlci_open(struct gsm_dlci *dlci) pr_debug("DLCI %d goes open.\n", dlci->addr); /* Register gsmtty driver,report gsmtty dev add uevent for user */ tty_register_device(gsm_tty_driver, dlci->addr, NULL); + if (dlci->addr) /* Send current modem state */ + gsmtty_modem_update(dlci, 0); wake_up(&dlci->gsm->event); } -- 2.25.1