linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] tty: n_gsm: delete SABM command frame as requester
@ 2021-07-01 11:27 Zhenguo Zhao
  2021-07-01 11:34 ` Greg KH
  2021-07-21 10:23 ` Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Zhenguo Zhao @ 2021-07-01 11:27 UTC (permalink / raw)
  To: zhenguo6858, gregkh, jirislaby; +Cc: linux-kernel

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

as initiator,it need to send SABM command ,as requester,there is
no need to send the SABM control frame,it will cause redundant data.

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

diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 5fea02c..41a6501 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -2997,6 +2997,7 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp)
 {
 	struct gsm_dlci *dlci = tty->driver_data;
 	struct tty_port *port = &dlci->port;
+	struct gsm_mux *gsm = dlci->gsm;
 
 	port->count++;
 	tty_port_tty_set(port, tty);
@@ -3005,8 +3006,9 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp)
 	/* We could in theory open and close before we wait - eg if we get
 	   a DM straight back. This is ok as that will have caused a hangup */
 	tty_port_set_initialized(port, 1);
-	/* Start sending off SABM messages */
-	gsm_dlci_begin_open(dlci);
+	/* Start sending off SABM messages for initiator */
+	if (gsm->initiator)
+		gsm_dlci_begin_open(dlci);
 	/* And wait for virtual carrier */
 	return tty_port_block_til_ready(port, tty, filp);
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] tty: n_gsm: delete SABM command frame as requester
  2021-07-01 11:27 [PATCH v2] tty: n_gsm: delete SABM command frame as requester Zhenguo Zhao
@ 2021-07-01 11:34 ` Greg KH
  2021-07-21 10:23 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2021-07-01 11:34 UTC (permalink / raw)
  To: Zhenguo Zhao; +Cc: jirislaby, linux-kernel

On Thu, Jul 01, 2021 at 07:27:20PM +0800, Zhenguo Zhao wrote:
> From: Zhenguo Zhao <Zhenguo.Zhao1@unisoc.com>
> 
> as initiator,it need to send SABM command ,as requester,there is
> no need to send the SABM control frame,it will cause redundant data.
> 
> Signed-off-by: Zhenguo Zhao <Zhenguo.Zhao1@unisoc.com>
> ---
>  drivers/tty/n_gsm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
> index 5fea02c..41a6501 100644
> --- a/drivers/tty/n_gsm.c
> +++ b/drivers/tty/n_gsm.c
> @@ -2997,6 +2997,7 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp)
>  {
>  	struct gsm_dlci *dlci = tty->driver_data;
>  	struct tty_port *port = &dlci->port;
> +	struct gsm_mux *gsm = dlci->gsm;
>  
>  	port->count++;
>  	tty_port_tty_set(port, tty);
> @@ -3005,8 +3006,9 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp)
>  	/* We could in theory open and close before we wait - eg if we get
>  	   a DM straight back. This is ok as that will have caused a hangup */
>  	tty_port_set_initialized(port, 1);
> -	/* Start sending off SABM messages */
> -	gsm_dlci_begin_open(dlci);
> +	/* Start sending off SABM messages for initiator */
> +	if (gsm->initiator)
> +		gsm_dlci_begin_open(dlci);
>  	/* And wait for virtual carrier */
>  	return tty_port_block_til_ready(port, tty, filp);
>  }
> -- 
> 1.9.1
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- This looks like a new version of a previously submitted patch, but you
  did not list below the --- line any changes from the previous version.
  Please read the section entitled "The canonical patch format" in the
  kernel file, Documentation/SubmittingPatches for what needs to be done
  here to properly describe this.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] tty: n_gsm: delete SABM command frame as requester
  2021-07-01 11:27 [PATCH v2] tty: n_gsm: delete SABM command frame as requester Zhenguo Zhao
  2021-07-01 11:34 ` Greg KH
@ 2021-07-21 10:23 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2021-07-21 10:23 UTC (permalink / raw)
  To: Zhenguo Zhao; +Cc: jirislaby, linux-kernel

On Thu, Jul 01, 2021 at 07:27:20PM +0800, Zhenguo Zhao wrote:
> From: Zhenguo Zhao <Zhenguo.Zhao1@unisoc.com>
> 
> as initiator,it need to send SABM command ,as requester,there is
> no need to send the SABM control frame,it will cause redundant data.

Same issue here with this text.  Please work on fixing it up to be
understood by others better.

> 
> Signed-off-by: Zhenguo Zhao <Zhenguo.Zhao1@unisoc.com>
> ---
>  drivers/tty/n_gsm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
> index 5fea02c..41a6501 100644
> --- a/drivers/tty/n_gsm.c
> +++ b/drivers/tty/n_gsm.c
> @@ -2997,6 +2997,7 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp)
>  {
>  	struct gsm_dlci *dlci = tty->driver_data;
>  	struct tty_port *port = &dlci->port;
> +	struct gsm_mux *gsm = dlci->gsm;
>  
>  	port->count++;
>  	tty_port_tty_set(port, tty);
> @@ -3005,8 +3006,9 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp)
>  	/* We could in theory open and close before we wait - eg if we get
>  	   a DM straight back. This is ok as that will have caused a hangup */
>  	tty_port_set_initialized(port, 1);
> -	/* Start sending off SABM messages */
> -	gsm_dlci_begin_open(dlci);
> +	/* Start sending off SABM messages for initiator */
> +	if (gsm->initiator)
> +		gsm_dlci_begin_open(dlci);

Why is this only an issue for initiators?  And why has no one reported
this problem before now?

Do you not also need to make ths same change somewhere else when
shutting down?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-21 10:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-01 11:27 [PATCH v2] tty: n_gsm: delete SABM command frame as requester Zhenguo Zhao
2021-07-01 11:34 ` Greg KH
2021-07-21 10:23 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).