linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nozomi: quick fix for the close/close bug
@ 2010-01-04 16:26 Alan Cox
  0 siblings, 0 replies; only message in thread
From: Alan Cox @ 2010-01-04 16:26 UTC (permalink / raw)
  To: greg, linux-serial

Nozomi goes wrong if you get the sequence

	open
	open
	close

	[stuff]
	close

which turns out to occur on some ppp type setups.

This is a quick patch up for the problem. It's not really fixing Nozomi
which completely fails to implement tty open/close semantics and all the
other needed stuff. Doing it right is a rather more invasive patch set and
not one that will backport.



Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/char/nozomi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c
index 7d73cd4..2ad7d37 100644
--- a/drivers/char/nozomi.c
+++ b/drivers/char/nozomi.c
@@ -1651,10 +1651,10 @@ static void ntty_close(struct tty_struct *tty, struct file *file)
 
 	dc->open_ttys--;
 	port->count--;
-	tty_port_tty_set(port, NULL);
 
 	if (port->count == 0) {
 		DBG1("close: %d", nport->token_dl);
+		tty_port_tty_set(port, NULL);
 		spin_lock_irqsave(&dc->spin_mutex, flags);
 		dc->last_ier &= ~(nport->token_dl);
 		writew(dc->last_ier, dc->reg_ier);


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-01-04 16:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-04 16:26 [PATCH] nozomi: quick fix for the close/close bug Alan Cox

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