public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: Alan Cox <alan@linux.intel.com>, stable <stable@kernel.org>,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 2/8] nozomi: quick fix for the close/close bug
Date: Wed, 20 Jan 2010 15:49:57 -0800	[thread overview]
Message-ID: <1264031403-32239-2-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <20100120234759.GC32068@kroah.com>

From: Alan Cox <alan@linux.intel.com>

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>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 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);
-- 
1.6.5.7


  parent reply	other threads:[~2010-01-20 23:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-20 23:47 [GIT PATCH] TTY patches for 2.6.33-rc4 Greg KH
2010-01-20 23:49 ` [PATCH 1/8] compat_ioctl: Supress "unknown cmd" message on serial /dev/console Greg Kroah-Hartman
2010-01-21  0:39   ` Arnd Bergmann
2010-01-20 23:49 ` Greg Kroah-Hartman [this message]
2010-01-20 23:49 ` [PATCH 3/8] serial: 8250_pnp: use wildcard for serial Wacom tablets Greg Kroah-Hartman
2010-01-20 23:49 ` [PATCH 4/8] serial-core: resume serial hardware with no_console_suspend Greg Kroah-Hartman
2010-01-20 23:50 ` [PATCH 5/8] serial: Fix crash if the minimum rate of the device is > 9600 baud Greg Kroah-Hartman
2010-01-20 23:50 ` [PATCH 6/8] serial: imx: bit &/| confusion Greg Kroah-Hartman
2010-01-21 13:34   ` Sascha Hauer
2010-01-20 23:50 ` [PATCH 7/8] serial: serial_cs: oxsemi quirk breaks resume Greg Kroah-Hartman
2010-01-20 23:50 ` [PATCH 8/8] tty: fix race in tty_fasync Greg Kroah-Hartman

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=1264031403-32239-2-git-send-email-gregkh@suse.de \
    --to=gregkh@suse.de \
    --cc=alan@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox