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,28 +2183,34 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, ...@@ -2183,28 +2183,34 @@ 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)) {
retval = -EIO; up_read(&tty->termios_rwsem);
break; tty_flush_to_ldisc(tty);
} down_read(&tty->termios_rwsem);
if (tty_hung_up_p(file)) if (!input_available_p(tty, 0)) {
break; retval = -EIO;
if (!timeout) break;
break; }
if (file->f_flags & O_NONBLOCK) { } else {
retval = -EAGAIN; if (tty_hung_up_p(file))
break; break;
} if (!timeout)
if (signal_pending(current)) { break;
retval = -ERESTARTSYS; if (file->f_flags & O_NONBLOCK) {
break; retval = -EAGAIN;
} break;
n_tty_set_room(tty); }
up_read(&tty->termios_rwsem); if (signal_pending(current)) {
retval = -ERESTARTSYS;
break;
}
n_tty_set_room(tty);
up_read(&tty->termios_rwsem);
timeout = schedule_timeout(timeout); timeout = schedule_timeout(timeout);
down_read(&tty->termios_rwsem); down_read(&tty->termios_rwsem);
continue; continue;
}
} }
__set_current_state(TASK_RUNNING); __set_current_state(TASK_RUNNING);
......
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