diff options
author | Jiri Slaby <jslaby@suse.cz> | 2011-11-16 10:27:08 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-17 14:36:12 -0500 |
commit | 300420722e0734a4254f3b634e0f82664495d210 (patch) | |
tree | a12f8d32e2e3cbde57f7af52d218f1ac3217064c | |
parent | df92d0561de364de53c42abc5d43e04ab6f326a5 (diff) |
TTY: ldisc, move wait idle to caller
It is the only place where reinit is called from. And we really need
to wait for the old ldisc to go once. Actually this is the place where
the waiting originally was (before removed and re-added later).
This will make the fix in the following patch easier to implement.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Dave Young <hidave.darkstar@gmail.com>
Cc: Dave Jones <davej@redhat.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Cc: Dmitriy Matrosov <sgf.dma@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/tty/tty_ldisc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c index 534d176a78ed..a69a755035b6 100644 --- a/drivers/tty/tty_ldisc.c +++ b/drivers/tty/tty_ldisc.c | |||
@@ -763,8 +763,6 @@ static int tty_ldisc_reinit(struct tty_struct *tty, int ldisc) | |||
763 | if (IS_ERR(ld)) | 763 | if (IS_ERR(ld)) |
764 | return -1; | 764 | return -1; |
765 | 765 | ||
766 | WARN_ON_ONCE(tty_ldisc_wait_idle(tty, 5 * HZ)); | ||
767 | |||
768 | tty_ldisc_close(tty, tty->ldisc); | 766 | tty_ldisc_close(tty, tty->ldisc); |
769 | tty_ldisc_put(tty->ldisc); | 767 | tty_ldisc_put(tty->ldisc); |
770 | tty->ldisc = NULL; | 768 | tty->ldisc = NULL; |
@@ -848,6 +846,8 @@ void tty_ldisc_hangup(struct tty_struct *tty) | |||
848 | it means auditing a lot of other paths so this is | 846 | it means auditing a lot of other paths so this is |
849 | a FIXME */ | 847 | a FIXME */ |
850 | if (tty->ldisc) { /* Not yet closed */ | 848 | if (tty->ldisc) { /* Not yet closed */ |
849 | WARN_ON_ONCE(tty_ldisc_wait_idle(tty, 5 * HZ)); | ||
850 | |||
851 | if (reset == 0) { | 851 | if (reset == 0) { |
852 | 852 | ||
853 | if (!tty_ldisc_reinit(tty, tty->termios->c_line)) | 853 | if (!tty_ldisc_reinit(tty, tty->termios->c_line)) |