diff options
-rw-r--r-- | drivers/char/n_tty.c | 1 | ||||
-rw-r--r-- | drivers/char/pty.c | 2 | ||||
-rw-r--r-- | drivers/char/tty_buffer.c | 13 | ||||
-rw-r--r-- | include/linux/tty.h | 1 |
4 files changed, 15 insertions, 2 deletions
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c index ff47907ff1bf..973be2f44195 100644 --- a/drivers/char/n_tty.c +++ b/drivers/char/n_tty.c | |||
@@ -1583,6 +1583,7 @@ static int n_tty_open(struct tty_struct *tty) | |||
1583 | 1583 | ||
1584 | static inline int input_available_p(struct tty_struct *tty, int amt) | 1584 | static inline int input_available_p(struct tty_struct *tty, int amt) |
1585 | { | 1585 | { |
1586 | tty_flush_to_ldisc(tty); | ||
1586 | if (tty->icanon) { | 1587 | if (tty->icanon) { |
1587 | if (tty->canon_data) | 1588 | if (tty->canon_data) |
1588 | return 1; | 1589 | return 1; |
diff --git a/drivers/char/pty.c b/drivers/char/pty.c index 3850a68f265a..6e6942c45f5b 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c | |||
@@ -52,7 +52,6 @@ static void pty_close(struct tty_struct *tty, struct file *filp) | |||
52 | return; | 52 | return; |
53 | tty->link->packet = 0; | 53 | tty->link->packet = 0; |
54 | set_bit(TTY_OTHER_CLOSED, &tty->link->flags); | 54 | set_bit(TTY_OTHER_CLOSED, &tty->link->flags); |
55 | tty_flip_buffer_push(tty->link); | ||
56 | wake_up_interruptible(&tty->link->read_wait); | 55 | wake_up_interruptible(&tty->link->read_wait); |
57 | wake_up_interruptible(&tty->link->write_wait); | 56 | wake_up_interruptible(&tty->link->write_wait); |
58 | if (tty->driver->subtype == PTY_TYPE_MASTER) { | 57 | if (tty->driver->subtype == PTY_TYPE_MASTER) { |
@@ -208,7 +207,6 @@ static int pty_open(struct tty_struct *tty, struct file *filp) | |||
208 | clear_bit(TTY_OTHER_CLOSED, &tty->link->flags); | 207 | clear_bit(TTY_OTHER_CLOSED, &tty->link->flags); |
209 | set_bit(TTY_THROTTLED, &tty->flags); | 208 | set_bit(TTY_THROTTLED, &tty->flags); |
210 | retval = 0; | 209 | retval = 0; |
211 | tty->low_latency = 1; | ||
212 | out: | 210 | out: |
213 | return retval; | 211 | return retval; |
214 | } | 212 | } |
diff --git a/drivers/char/tty_buffer.c b/drivers/char/tty_buffer.c index 810ee25d66a4..3108991c5c8b 100644 --- a/drivers/char/tty_buffer.c +++ b/drivers/char/tty_buffer.c | |||
@@ -462,6 +462,19 @@ static void flush_to_ldisc(struct work_struct *work) | |||
462 | } | 462 | } |
463 | 463 | ||
464 | /** | 464 | /** |
465 | * tty_flush_to_ldisc | ||
466 | * @tty: tty to push | ||
467 | * | ||
468 | * Push the terminal flip buffers to the line discipline. | ||
469 | * | ||
470 | * Must not be called from IRQ context. | ||
471 | */ | ||
472 | void tty_flush_to_ldisc(struct tty_struct *tty) | ||
473 | { | ||
474 | flush_to_ldisc(&tty->buf.work.work); | ||
475 | } | ||
476 | |||
477 | /** | ||
465 | * tty_flip_buffer_push - terminal | 478 | * tty_flip_buffer_push - terminal |
466 | * @tty: tty to push | 479 | * @tty: tty to push |
467 | * | 480 | * |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 1488d8c81aac..e8c6c9136c97 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -394,6 +394,7 @@ extern void __do_SAK(struct tty_struct *tty); | |||
394 | extern void disassociate_ctty(int priv); | 394 | extern void disassociate_ctty(int priv); |
395 | extern void no_tty(void); | 395 | extern void no_tty(void); |
396 | extern void tty_flip_buffer_push(struct tty_struct *tty); | 396 | extern void tty_flip_buffer_push(struct tty_struct *tty); |
397 | extern void tty_flush_to_ldisc(struct tty_struct *tty); | ||
397 | extern void tty_buffer_free_all(struct tty_struct *tty); | 398 | extern void tty_buffer_free_all(struct tty_struct *tty); |
398 | extern void tty_buffer_flush(struct tty_struct *tty); | 399 | extern void tty_buffer_flush(struct tty_struct *tty); |
399 | extern void tty_buffer_init(struct tty_struct *tty); | 400 | extern void tty_buffer_init(struct tty_struct *tty); |