Commit 3ff51a19 authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman

tty: Remove TTY_HUPPING

Now that tty_ldisc_hangup() does not drop the tty lock, it is no
longer possible to observe TTY_HUPPING while holding the tty lock
on another cpu.

Remove TTY_HUPPING bit definition.
Reviewed-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c8483bc9
...@@ -690,9 +690,6 @@ static void __tty_hangup(struct tty_struct *tty, int exit_session) ...@@ -690,9 +690,6 @@ static void __tty_hangup(struct tty_struct *tty, int exit_session)
return; return;
} }
/* some functions below drop BTM, so we need this bit */
set_bit(TTY_HUPPING, &tty->flags);
/* inuse_filps is protected by the single tty lock, /* inuse_filps is protected by the single tty lock,
this really needs to change if we want to flush the this really needs to change if we want to flush the
workqueue with the lock held */ workqueue with the lock held */
...@@ -717,10 +714,6 @@ static void __tty_hangup(struct tty_struct *tty, int exit_session) ...@@ -717,10 +714,6 @@ static void __tty_hangup(struct tty_struct *tty, int exit_session)
while (refs--) while (refs--)
tty_kref_put(tty); tty_kref_put(tty);
/*
* it drops BTM and thus races with reopen
* we protect the race by TTY_HUPPING
*/
tty_ldisc_hangup(tty); tty_ldisc_hangup(tty);
spin_lock_irq(&tty->ctrl_lock); spin_lock_irq(&tty->ctrl_lock);
...@@ -752,8 +745,6 @@ static void __tty_hangup(struct tty_struct *tty, int exit_session) ...@@ -752,8 +745,6 @@ static void __tty_hangup(struct tty_struct *tty, int exit_session)
* can't yet guarantee all that. * can't yet guarantee all that.
*/ */
set_bit(TTY_HUPPED, &tty->flags); set_bit(TTY_HUPPED, &tty->flags);
clear_bit(TTY_HUPPING, &tty->flags);
tty_unlock(tty); tty_unlock(tty);
if (f) if (f)
...@@ -1461,8 +1452,7 @@ static int tty_reopen(struct tty_struct *tty) ...@@ -1461,8 +1452,7 @@ static int tty_reopen(struct tty_struct *tty)
{ {
struct tty_driver *driver = tty->driver; struct tty_driver *driver = tty->driver;
if (test_bit(TTY_CLOSING, &tty->flags) || if (test_bit(TTY_CLOSING, &tty->flags))
test_bit(TTY_HUPPING, &tty->flags))
return -EIO; return -EIO;
if (driver->type == TTY_DRIVER_TYPE_PTY && if (driver->type == TTY_DRIVER_TYPE_PTY &&
......
...@@ -544,8 +544,7 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc) ...@@ -544,8 +544,7 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc)
old_ldisc = tty->ldisc; old_ldisc = tty->ldisc;
if (test_bit(TTY_HUPPING, &tty->flags) || if (test_bit(TTY_HUPPED, &tty->flags)) {
test_bit(TTY_HUPPED, &tty->flags)) {
/* We were raced by the hangup method. It will have stomped /* We were raced by the hangup method. It will have stomped
the ldisc data and closed the ldisc down */ the ldisc data and closed the ldisc down */
tty_ldisc_enable_pair(tty, o_tty); tty_ldisc_enable_pair(tty, o_tty);
......
...@@ -321,7 +321,6 @@ struct tty_file_private { ...@@ -321,7 +321,6 @@ struct tty_file_private {
#define TTY_PTY_LOCK 16 /* pty private */ #define TTY_PTY_LOCK 16 /* pty private */
#define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ #define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */
#define TTY_HUPPED 18 /* Post driver->hangup() */ #define TTY_HUPPED 18 /* Post driver->hangup() */
#define TTY_HUPPING 21 /* ->hangup() in progress */
#define TTY_LDISC_HALTED 22 /* Line discipline is halted */ #define TTY_LDISC_HALTED 22 /* Line discipline is halted */
#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment