All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhenguo Zhao <zhenguo6858@gmail.com>
To: zhenguo6858@gmail.com, gregkh@linuxfoundation.org, jirislaby@kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] tty: n_gsm: delete CLD command frame as requester
Date: Thu,  1 Jul 2021 13:58:05 +0800	[thread overview]
Message-ID: <1625119085-18200-1-git-send-email-zhenguo6858@gmail.com> (raw)

From: Zhenguo Zhao <Zhenguo.Zhao1@unisoc.com>

as initiator,it may be send CLD conmmand ,as requester,there is
no need to send the CLD control frame,it will cause redundant data.

Signed-off-by: Zhenguo Zhao <Zhenguo.Zhao1@unisoc.com>
---
 drivers/tty/n_gsm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 5fea02c..eecbc76 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -2043,9 +2043,11 @@ static int gsm_disconnect(struct gsm_mux *gsm)
 
 	/* In theory disconnecting DLCI 0 is sufficient but for some
 	   modems this is apparently not the case. */
-	gc = gsm_control_send(gsm, CMD_CLD, NULL, 0);
-	if (gc)
-		gsm_control_wait(gsm, gc);
+	if (gsm->initiator) {
+		gc = gsm_control_send(gsm, CMD_CLD, NULL, 0);
+		if (gc)
+			gsm_control_wait(gsm, gc);
+	}
 
 	del_timer_sync(&gsm->t2_timer);
 	/* Now we are sure T2 has stopped */
-- 
1.9.1


             reply	other threads:[~2021-07-01  5:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01  5:58 Zhenguo Zhao [this message]
2021-07-21 10:24 ` [PATCH] tty: n_gsm: delete CLD command frame as requester Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1625119085-18200-1-git-send-email-zhenguo6858@gmail.com \
    --to=zhenguo6858@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.