linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] tty: not call tty close in fallback
       [not found] <1547448961-9588-1-git-send-email-yes>
@ 2019-01-14  7:20 ` Jiri Slaby
  2019-01-14  7:51 ` Jiri Slaby
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2019-01-14  7:20 UTC (permalink / raw)
  To: yes, robh, gregkh, linux-kernel, linux-serial

On 14. 01. 19, 7:56, yes@hpe.com wrote:
> From: Li RongQing <lirongqing@baidu.com>
> 
> when fail to open tty, tty is not in open status and not need
> to call close

But tty drivers are special and expect close even on failed open, right?
See tty_open.

> Signed-off-by: Li RongQing <lirongqing@baidu.com>
> ---
>  drivers/tty/serdev/serdev-ttyport.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
> index fa1672993b4c..bcc1e27d00de 100644
> --- a/drivers/tty/serdev/serdev-ttyport.c
> +++ b/drivers/tty/serdev/serdev-ttyport.c
> @@ -121,7 +121,7 @@ static int ttyport_open(struct serdev_controller *ctrl)
>  
>  	ret = tty->ops->open(serport->tty, NULL);
>  	if (ret)
> -		goto err_close;
> +		goto err_unlock;
>  
>  	tty_unlock(serport->tty);
>  
> @@ -142,8 +142,6 @@ static int ttyport_open(struct serdev_controller *ctrl)
>  
>  	return 0;
>  
> -err_close:
> -	tty->ops->close(tty, NULL);
>  err_unlock:
>  	tty_unlock(tty);
>  	tty_release_struct(tty, serport->tty_idx);
> 

thanks,
-- 
js
suse labs

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

* Re: [PATCH] tty: not call tty close in fallback
       [not found] <1547448961-9588-1-git-send-email-yes>
  2019-01-14  7:20 ` [PATCH] tty: not call tty close in fallback Jiri Slaby
@ 2019-01-14  7:51 ` Jiri Slaby
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2019-01-14  7:51 UTC (permalink / raw)
  To: lirongqing, robh, gregkh, linux-kernel, linux-serial

yes@hpe.com:

550 5.1.1 User Unknown

You are sending e-mails/patches from a non-existant address?

On 14. 01. 19, 7:56, yes@hpe.com wrote:
> From: Li RongQing <lirongqing@baidu.com>
> 
> when fail to open tty, tty is not in open status and not need
> to call close

But tty drivers are special and expect close even on failed open, right?
See tty_open.

> Signed-off-by: Li RongQing <lirongqing@baidu.com>
> ---
>  drivers/tty/serdev/serdev-ttyport.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
> index fa1672993b4c..bcc1e27d00de 100644
> --- a/drivers/tty/serdev/serdev-ttyport.c
> +++ b/drivers/tty/serdev/serdev-ttyport.c
> @@ -121,7 +121,7 @@ static int ttyport_open(struct serdev_controller *ctrl)
>  
>  	ret = tty->ops->open(serport->tty, NULL);
>  	if (ret)
> -		goto err_close;
> +		goto err_unlock;
>  
>  	tty_unlock(serport->tty);
>  
> @@ -142,8 +142,6 @@ static int ttyport_open(struct serdev_controller *ctrl)
>  
>  	return 0;
>  
> -err_close:
> -	tty->ops->close(tty, NULL);
>  err_unlock:
>  	tty_unlock(tty);
>  	tty_release_struct(tty, serport->tty_idx);
> 

thanks,
-- 
js
suse labs

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

* Re: [PATCH] tty: not call tty close in fallback
       [not found] <5c3c3289.1c69fb81.c1953.0900SMTPIN_ADDED_BROKEN@mx.google.com>
@ 2019-02-19 12:41 ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2019-02-19 12:41 UTC (permalink / raw)
  To: yes; +Cc: robh, jslaby, linux-serial, linux-kernel

On Mon, Jan 14, 2019 at 02:56:01PM +0800, yes wrote:
> From: Li RongQing <lirongqing@baidu.com>
> 
> when fail to open tty, tty is not in open status and not need
> to call close
> 
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
> ---
>  drivers/tty/serdev/serdev-ttyport.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
> index fa1672993b4c..bcc1e27d00de 100644
> --- a/drivers/tty/serdev/serdev-ttyport.c
> +++ b/drivers/tty/serdev/serdev-ttyport.c
> @@ -121,7 +121,7 @@ static int ttyport_open(struct serdev_controller *ctrl)
>  
>  	ret = tty->ops->open(serport->tty, NULL);
>  	if (ret)
> -		goto err_close;
> +		goto err_unlock;
>  
>  	tty_unlock(serport->tty);
>  
> @@ -142,8 +142,6 @@ static int ttyport_open(struct serdev_controller *ctrl)
>  
>  	return 0;
>  
> -err_close:
> -	tty->ops->close(tty, NULL);

No, close is always called after open, even if open fails.

thanks,

greg k-h

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

end of thread, other threads:[~2019-02-19 12:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1547448961-9588-1-git-send-email-yes>
2019-01-14  7:20 ` [PATCH] tty: not call tty close in fallback Jiri Slaby
2019-01-14  7:51 ` Jiri Slaby
     [not found] <5c3c3289.1c69fb81.c1953.0900SMTPIN_ADDED_BROKEN@mx.google.com>
2019-02-19 12:41 ` 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).