Commit 30042072 authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

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: default avatarJiri 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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent df92d056
...@@ -763,8 +763,6 @@ static int tty_ldisc_reinit(struct tty_struct *tty, int ldisc) ...@@ -763,8 +763,6 @@ static int tty_ldisc_reinit(struct tty_struct *tty, int ldisc)
if (IS_ERR(ld)) if (IS_ERR(ld))
return -1; return -1;
WARN_ON_ONCE(tty_ldisc_wait_idle(tty, 5 * HZ));
tty_ldisc_close(tty, tty->ldisc); tty_ldisc_close(tty, tty->ldisc);
tty_ldisc_put(tty->ldisc); tty_ldisc_put(tty->ldisc);
tty->ldisc = NULL; tty->ldisc = NULL;
...@@ -848,6 +846,8 @@ void tty_ldisc_hangup(struct tty_struct *tty) ...@@ -848,6 +846,8 @@ void tty_ldisc_hangup(struct tty_struct *tty)
it means auditing a lot of other paths so this is it means auditing a lot of other paths so this is
a FIXME */ a FIXME */
if (tty->ldisc) { /* Not yet closed */ if (tty->ldisc) { /* Not yet closed */
WARN_ON_ONCE(tty_ldisc_wait_idle(tty, 5 * HZ));
if (reset == 0) { if (reset == 0) {
if (!tty_ldisc_reinit(tty, tty->termios->c_line)) if (!tty_ldisc_reinit(tty, tty->termios->c_line))
......
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