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

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

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

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

diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 5fea02c..1aa87d9 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -2050,7 +2050,8 @@ static int gsm_disconnect(struct gsm_mux *gsm)
 	del_timer_sync(&gsm->t2_timer);
 	/* Now we are sure T2 has stopped */
 
-	gsm_dlci_begin_close(dlci);
+	if (gsm->initiator)
+		gsm_dlci_begin_close(dlci);
 	wait_event_interruptible(gsm->event,
 				dlci->state == DLCI_CLOSED);
 
@@ -3014,6 +3015,7 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp)
 static void gsmtty_close(struct tty_struct *tty, struct file *filp)
 {
 	struct gsm_dlci *dlci = tty->driver_data;
+	struct gsm_mux *gsm = dlci->gsm;
 
 	if (dlci == NULL)
 		return;
@@ -3024,7 +3026,8 @@ static void gsmtty_close(struct tty_struct *tty, struct file *filp)
 	mutex_unlock(&dlci->mutex);
 	if (tty_port_close_start(&dlci->port, tty, filp) == 0)
 		return;
-	gsm_dlci_begin_close(dlci);
+	if (gsm->initiator)
+		gsm_dlci_begin_close(dlci);
 	if (tty_port_initialized(&dlci->port) && C_HUPCL(tty))
 		tty_port_lower_dtr_rts(&dlci->port);
 	tty_port_close_end(&dlci->port, tty);
@@ -3038,7 +3041,8 @@ static void gsmtty_hangup(struct tty_struct *tty)
 	if (dlci->state == DLCI_CLOSED)
 		return;
 	tty_port_hangup(&dlci->port);
-	gsm_dlci_begin_close(dlci);
+	if (gsm->initiator)
+		gsm_dlci_begin_close(dlci);
 }
 
 static int gsmtty_write(struct tty_struct *tty, const unsigned char *buf,
-- 
1.9.1


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

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

On Thu, Jul 01, 2021 at 07:42:03PM +0800, Zhenguo Zhao wrote:
> From: Zhenguo Zhao <Zhenguo.Zhao1@unisoc.com>
> 
> as initiator,it need to send DISC command ,as requester,there is
> no need to send the DISC control frame,it will cause redundant data.
> 
> Signed-off-by: Zhenguo Zhao <Zhenguo.Zhao1@unisoc.com>
> ---
>  drivers/tty/n_gsm.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
> index 5fea02c..1aa87d9 100644
> --- a/drivers/tty/n_gsm.c
> +++ b/drivers/tty/n_gsm.c
> @@ -2050,7 +2050,8 @@ static int gsm_disconnect(struct gsm_mux *gsm)
>  	del_timer_sync(&gsm->t2_timer);
>  	/* Now we are sure T2 has stopped */
>  
> -	gsm_dlci_begin_close(dlci);
> +	if (gsm->initiator)
> +		gsm_dlci_begin_close(dlci);
>  	wait_event_interruptible(gsm->event,
>  				dlci->state == DLCI_CLOSED);
>  
> @@ -3014,6 +3015,7 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp)
>  static void gsmtty_close(struct tty_struct *tty, struct file *filp)
>  {
>  	struct gsm_dlci *dlci = tty->driver_data;
> +	struct gsm_mux *gsm = dlci->gsm;
>  
>  	if (dlci == NULL)
>  		return;
> @@ -3024,7 +3026,8 @@ static void gsmtty_close(struct tty_struct *tty, struct file *filp)
>  	mutex_unlock(&dlci->mutex);
>  	if (tty_port_close_start(&dlci->port, tty, filp) == 0)
>  		return;
> -	gsm_dlci_begin_close(dlci);
> +	if (gsm->initiator)
> +		gsm_dlci_begin_close(dlci);
>  	if (tty_port_initialized(&dlci->port) && C_HUPCL(tty))
>  		tty_port_lower_dtr_rts(&dlci->port);
>  	tty_port_close_end(&dlci->port, tty);
> @@ -3038,7 +3041,8 @@ static void gsmtty_hangup(struct tty_struct *tty)
>  	if (dlci->state == DLCI_CLOSED)
>  		return;
>  	tty_port_hangup(&dlci->port);
> -	gsm_dlci_begin_close(dlci);
> +	if (gsm->initiator)
> +		gsm_dlci_begin_close(dlci);
>  }
>  
>  static int gsmtty_write(struct tty_struct *tty, const unsigned char *buf,
> -- 
> 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 DISC command frame as requester
  2021-07-01 11:42 [PATCH v2] tty: n_gsm: delete DISC command frame as requester Zhenguo Zhao
  2021-07-01 11:46 ` Greg KH
@ 2021-07-03 11:42 ` kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-07-03 11:42 UTC (permalink / raw)
  To: Zhenguo Zhao, gregkh, jirislaby; +Cc: kbuild-all, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2073 bytes --]

Hi Zhenguo,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tty/tty-testing]
[also build test ERROR on v5.13 next-20210701]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Zhenguo-Zhao/tty-n_gsm-delete-DISC-command-frame-as-requester/20210701-194354
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
config: x86_64-rhel-8.3 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/d4797539c16d71ca9d1f2b1a6959618c20a62d0d
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Zhenguo-Zhao/tty-n_gsm-delete-DISC-command-frame-as-requester/20210701-194354
        git checkout d4797539c16d71ca9d1f2b1a6959618c20a62d0d
        # save the attached .config to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/tty/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/tty/n_gsm.c: In function 'gsmtty_hangup':
>> drivers/tty/n_gsm.c:3047:6: error: 'gsm' undeclared (first use in this function)
    3047 |  if (gsm->initiator)
         |      ^~~
   drivers/tty/n_gsm.c:3047:6: note: each undeclared identifier is reported only once for each function it appears in


vim +/gsm +3047 drivers/tty/n_gsm.c

  3040	
  3041	static void gsmtty_hangup(struct tty_struct *tty)
  3042	{
  3043		struct gsm_dlci *dlci = tty->driver_data;
  3044		if (dlci->state == DLCI_CLOSED)
  3045			return;
  3046		tty_port_hangup(&dlci->port);
> 3047		if (gsm->initiator)
  3048			gsm_dlci_begin_close(dlci);
  3049	}
  3050	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 41440 bytes --]

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

end of thread, other threads:[~2021-07-03 11:42 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:42 [PATCH v2] tty: n_gsm: delete DISC command frame as requester Zhenguo Zhao
2021-07-01 11:46 ` Greg KH
2021-07-03 11:42 ` kernel test robot

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).