Signed-off-by: Matthieu CASTET <castet.matthieu@xxxxxxx> --- drivers/tty/n_tty.c | 1 + drivers/tty/tty_buffer.c | 5 +++++ drivers/tty/tty_ldisc.c | 7 ------- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index ed5a976..5ef5a22 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@ -190,6 +190,7 @@ static void reset_buffer_flags(struct tty_struct *tty) tty->canon_head = tty->canon_data = tty->erasing = 0; memset(&tty->read_flags, 0, sizeof tty->read_flags); + tty->receive_room = 0; n_tty_set_room(tty); } diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index 6c9b7cd..0e0f0fa 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c @@ -432,6 +432,11 @@ static void flush_to_ldisc(struct work_struct *work) line discipline as we want to empty the queue */ if (test_bit(TTY_FLUSHPENDING, &tty->flags)) break; + /* + * No more input please, we are switching. + */ + if (test_bit(TTY_LDISC_CHANGING, &tty->flags)) + break; if (!tty->receive_room) break; if (count > tty->receive_room) diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c index 24b95db..ab0a180 100644 --- a/drivers/tty/tty_ldisc.c +++ b/drivers/tty/tty_ldisc.c @@ -613,13 +613,6 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc) set_bit(TTY_LDISC_CHANGING, &tty->flags); - /* - * No more input please, we are switching. The new ldisc - * will update this value in the ldisc open function - */ - - tty->receive_room = 0; - o_ldisc = tty->ldisc; tty_unlock(); -- 1.7.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html