TTY fixes for 3.12-rc4
Here are 2 tty driver fixes for 3.12-rc4. One fixes the reported regression in the n_tty code that a number of people found recently, and the other one fixes an issue with xen consoles that broke in 3.10. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.21 (GNU/Linux) iEYEABECAAYFAlJQTOgACgkQMUfUDdst+ym/EQCdFJ3hmK57vr69oSndkzV5Mx2/ ZqsAn1NPAK5j3Wtkl0eoHe8HSLDu8VGC =pqUF -----END PGP SIGNATURE----- Merge tag 'tty-3.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty fixes from Greg KH: "Here are two tty driver fixes for 3.12-rc4. One fixes the reported regression in the n_tty code that a number of people found recently, and the other one fixes an issue with xen consoles that broke in 3.10" * tag 'tty-3.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: xen/hvc: allow xenboot console to be used again tty: Fix pty master read() after slave closes
This commit is contained in:
commit
e3757a1f0b
2 changed files with 27 additions and 20 deletions
|
@ -636,6 +636,7 @@ struct console xenboot_console = {
|
||||||
.name = "xenboot",
|
.name = "xenboot",
|
||||||
.write = xenboot_write_console,
|
.write = xenboot_write_console,
|
||||||
.flags = CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME,
|
.flags = CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME,
|
||||||
|
.index = -1,
|
||||||
};
|
};
|
||||||
#endif /* CONFIG_EARLY_PRINTK */
|
#endif /* CONFIG_EARLY_PRINTK */
|
||||||
|
|
||||||
|
|
|
@ -2183,9 +2183,14 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
|
||||||
|
|
||||||
if (!input_available_p(tty, 0)) {
|
if (!input_available_p(tty, 0)) {
|
||||||
if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) {
|
if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) {
|
||||||
|
up_read(&tty->termios_rwsem);
|
||||||
|
tty_flush_to_ldisc(tty);
|
||||||
|
down_read(&tty->termios_rwsem);
|
||||||
|
if (!input_available_p(tty, 0)) {
|
||||||
retval = -EIO;
|
retval = -EIO;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
if (tty_hung_up_p(file))
|
if (tty_hung_up_p(file))
|
||||||
break;
|
break;
|
||||||
if (!timeout)
|
if (!timeout)
|
||||||
|
@ -2206,6 +2211,7 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
|
||||||
down_read(&tty->termios_rwsem);
|
down_read(&tty->termios_rwsem);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
__set_current_state(TASK_RUNNING);
|
__set_current_state(TASK_RUNNING);
|
||||||
|
|
||||||
/* Deal with packet mode. */
|
/* Deal with packet mode. */
|
||||||
|
|
Loading…
Add table
Reference in a new issue