Commit e3757a1f authored by Linus Torvalds's avatar Linus Torvalds

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
parents 20fa7867 a9fbf4d5
...@@ -636,6 +636,7 @@ struct console xenboot_console = { ...@@ -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, ...@@ -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, ...@@ -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. */
......
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