Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3870154pxb; Tue, 19 Apr 2022 11:26:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdBWE9ZcJ8y8Nd4i7YyT8akTgf4lfhWJAFurWUwMUMH0kw7LGN43aBAX8HeK4x6h593DeH X-Received: by 2002:a17:902:bd0c:b0:158:f864:4d9d with SMTP id p12-20020a170902bd0c00b00158f8644d9dmr12004812pls.13.1650392816256; Tue, 19 Apr 2022 11:26:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650392816; cv=none; d=google.com; s=arc-20160816; b=W/Db1xD8BEeM86hF5NVXfOCgvzdUO7xKiWEGH+DXzjV2ScdL33V2v+6uUNMdUrO8AW dmRcojRk4II/EAixqS7X466OGaMcDWW7WjEhQZ3mCZJX/xf5uD2xvtqNZAXowpsjlkvL zy53Lu/avNLXVH9cKZo1jgxGitKviqEnRCgChTt24lLcqXm8WqSzpirOhnu/ZzHYML3L EH99F5+pZNyLTOPAnATacWobWMWmy6nuf7RJYcp/fnATsXmT1ks5buafbrekjwbe7p1Y ZwzWndKWIJYO4xru3VlZHXLIl/78fa43GO8wjX3U+LSxaeSdnoTDaKDWYKkZwr8DGu1H CwSQ== 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=wpl+486sr7a22vbdMzfanbhjqUxRTVD+M5ueXoQSE64=; b=dPyoKkm42vdNj0x5z+7vEXXNmuV186Icrguzp8JlznC5HS+f/QqH3o5RxSAZjgrZYS 67uKcM83PKrNdmgb3NtOsIh2dUTsw3IMSN873QIjuFber7bB0/+WWnSX6sRQASlqQhmj 43wUK+F+u1Dybx9m++/FZh3hV7PD+EHbZ8YUL5QyShTo2kc6g0vEQw2kZvCyM8Fbm7sj yYKdEqVJvaFZNYqwILo7r8+b1Iy8EFyz99yxFdJK03aN48DCoaDsS0CQgoOxbq43o2BG LYmxYiVCfJG6fDT7fTC7gshPvaTGQaDclY1BK4G7yLNaQ876t21dx7EeqJuho0ujw7pw WTjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=BseYIEuS; 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 a5-20020a656045000000b003863915bbb4si1479pgp.673.2022.04.19.11.26.40; Tue, 19 Apr 2022 11:26:56 -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=BseYIEuS; 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 S1349717AbiDSILZ (ORCPT + 99 others); Tue, 19 Apr 2022 04:11:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243633AbiDSILW (ORCPT ); Tue, 19 Apr 2022 04:11:22 -0400 X-Greylist: delayed 62 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 19 Apr 2022 01:08:37 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 ADDDE27FCE for ; Tue, 19 Apr 2022 01:08:37 -0700 (PDT) Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 2022041908073224b770bf3ad841af0b for ; Tue, 19 Apr 2022 10:07:33 +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=wpl+486sr7a22vbdMzfanbhjqUxRTVD+M5ueXoQSE64=; b=BseYIEuS0itiYBiNIdvmZiwlpWrkKtzGGm4b3nPxSGViZzGaoOG6pCxtlTau3xJWdRiK1U ZmFGtHGnBytmWRYc3oHiHqzlf9oA739zQfuvCprEzdcGCZ5fwobFEUQpvDTjeuXl38+eMv0M J7ac0F8Tffvr0ilth/63Zc407otvg=; 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 v2 15/20] tty: n_gsm: fix missing update of modem controls after DLCI open Date: Tue, 19 Apr 2022 01:07:24 -0700 Message-Id: <20220419080724.5726-1-daniel.starke@siemens.com> In-Reply-To: References: 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index f3fb66be8513..07d03447cdfd 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -370,6 +370,7 @@ static const u8 gsm_fcs8[256] = { #define GOOD_FCS 0xCF 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 +1480,9 @@ 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); + /* Send current modem state */ + if (dlci->addr) + gsmtty_modem_update(dlci, 0); wake_up(&dlci->gsm->event); } -- 2.25.1