Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp4450435pxb; Wed, 20 Apr 2022 03:36:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxn8zSS0gilhJWi2322kYeevrW4JXZ/v6SIR3j53nwK3AAFyYGu8aBxlL22kqno2NIU8/dO X-Received: by 2002:a05:6402:458:b0:418:78a4:ac3f with SMTP id p24-20020a056402045800b0041878a4ac3fmr22142640edw.196.1650450961982; Wed, 20 Apr 2022 03:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650450961; cv=none; d=google.com; s=arc-20160816; b=XvklwT2eHhX+R3ewkkekNqmswP1gD/heXkgHMuEsK+VKb7/p7rED/cb8XKHJgOku24 0O3zt2NwihDwfpgMUBXzs6HbQ59dW7Be6Dix4a+PHHidreUPBVMIDw+bHS2vm+ekllDZ qqk2xqyo0A9X2Zy/V20Y6TZ5J3RGEp4wwTQ1nh88iZHsJUttFO3by8edqksRj7OHUSDh aMVAdWxDJ1At/qw++idmZcoNyc0t2WpKqb+ZhxAj/IoapMmgBe6NlprcUOaX0yDd/tEr 4kJJE+82BPqtekdXzyoeHEHlaYzHRBcIP7/jBt7C2Ns6gweGF1zS1R1nfo3D4a1epuc6 rk6Q== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=FFNQWKAaa+tOjtARGnA7TybHGnCzkS3/CB981T3WncY=; b=uCuC5vcSOT7+zNVk2juMc/BfiLKeI30fz5S8uwYMxGxD/00D5m+le7IePYEs7sfCeC p+Qo8e600l+X5KMzx5EPOeM8CMnWNi9YmefQPNZAq9EBU+ugLZHHvD7nXKo9juG+czWC vslVAUVRxXhaX5WVtUIUbeAbDydfNZ+EmLSGh6tFPK2moPDZtERoB3H+6yiztvUAj6KF 3BmJyMoi4WavuuTM2S7l+cOCAdFtrU8kywl1EWGbL/PxT/nl7fQ59ylcE4cRzrCasZNQ 0FkgnrVxHvSbTGP5/s9peW4MYxRhTJtS2ZsVGioaE/5H+GDd2/ca0cDHGBJTwqmyoQqg KXhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=Jxe2OEim; 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 cw3-20020a056402228300b00423e99aea64si1015536edb.341.2022.04.20.03.35.37; Wed, 20 Apr 2022 03:36:01 -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=Jxe2OEim; 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 S1377532AbiDTKR4 (ORCPT + 99 others); Wed, 20 Apr 2022 06:17:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377537AbiDTKRv (ORCPT ); Wed, 20 Apr 2022 06:17:51 -0400 X-Greylist: delayed 62 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 20 Apr 2022 03:15:03 PDT Received: from mta-65-225.siemens.flowmailer.net (mta-65-225.siemens.flowmailer.net [185.136.65.225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4D292BD7 for ; Wed, 20 Apr 2022 03:15:01 -0700 (PDT) Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 2022042010135683572b2da7f9cb76e8 for ; Wed, 20 Apr 2022 12:13:57 +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; bh=FFNQWKAaa+tOjtARGnA7TybHGnCzkS3/CB981T3WncY=; b=Jxe2OEimlwTyMCpTX0/NgKmNH7P443a28SYHynIN8TAOlyKUOPHLzDJD+2Etu2PR8oIXe7 kJcJsIYO+hBuUDG1yZ1BNcNEbPjL9bRbYrMrwUMTg/AoNHbqJe83cASB76wYuIfxDACSpdhE tCxC/optrbE8ZVSHRzowMaq8RDFH0=; 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 v3 1/3] tty: n_gsm: fix missing update of modem controls after DLCI open Date: Wed, 20 Apr 2022 03:13:44 -0700 Message-Id: <20220420101346.3315-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_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS 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 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(+) All remarks have been incorporated. Compared to the original patch the additional comment on the prototypes was removed and the comment in gsm_dlci_open() was moved to a separate line. The commit message remains unchanged. This is version 3 of the patch because the second version was missing the change remarks. Link: https://lore.kernel.org/all/YlkQ5Jh8HIm+AJHe@kroah.com/ 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