All of
 help / color / mirror / Atom feed
From: Alan Cox <>
To: "Govindraj.R" <>
	Greg Kroah-Hartman <>,
	Alan Cox <>
Subject: Re: [PATCH] tty: serial_core: Add mechanism to identify port closure.
Date: Fri, 20 Apr 2012 14:27:40 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> index 9c4c05b..0dc246d 100644
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -1284,6 +1284,8 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
>  		uart_wait_until_sent(tty, uport->timeout);
>  	}
> +	state->uart_port->closing = true;

So what are the locking rules for this - when is it valid and when can it
be tested.

This also still seems a hack to me - the core tty code doesn't have
suspend/resume/open/close confused. The uart layer does, so really the
uart layer needs untangling. I'm skeptical yet another magic state
variable is the answer, particularly when the locking model for the
variable appears undefined.

Teach the uart core code to pass an extra argument indicating whether its
really doing shutdown/open or merely doing suspend/resume. It's perfectly
sensible that it tries to use the same helper for both, its broken that
the called code cannot tell which.

The parameter would also be a local variable which avoids all the locking


  reply	other threads:[~2012-04-20 13:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-20 10:57 Govindraj.R
2012-04-20 13:27 ` Alan Cox [this message]
2012-04-23  8:55   ` Raja, Govindraj
2012-04-23 10:07     ` Alan Cox

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:

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

  git send-email \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] tty: serial_core: Add mechanism to identify port closure.' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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.