Skip to content

Commit

Permalink
Merge tag 'tty-3.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/gregkh/tty

Pull tty/serial fixes from Greg KH:
 "Here are some tty/serial driver fixes for reported issues in 3.13-rc2.

  The n_gsm "fix" was reverted as it was found to not be correct.
  Hopefully this will be resolved in a future pull request, but as
  there's really only one user of this line setting, it's not a big
  deal..."

* tag 'tty-3.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  Revert "n_gsm: race between ld close and gsmtty open"
  n_tty: Protect minimum_to_wake reset for concurrent readers
  tty: Reset hupped state on open
  TTY: amiserial, add missing platform check
  TTY: pmac_zilog, check existence of ports in pmz_console_init()
  n_gsm: race between ld close and gsmtty open
  tty/serial/8250: fix typo in help text
  n_tty: Fix 4096-byte canonical reads
  n_tty: Fix echo overrun tail computation
  n_tty: Ensure reader restarts worker for next reader
  • Loading branch information
torvalds committed Nov 28, 2013
2 parents 0b0f7f1 + c42b4e6 commit 682a251
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
3 changes: 3 additions & 0 deletions drivers/tty/amiserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1855,6 +1855,9 @@ static struct console sercons = {
*/
static int __init amiserial_console_init(void)
{
if (!MACH_IS_AMIGA)
return -ENODEV;

register_console(&sercons);
return 0;
}
Expand Down
16 changes: 10 additions & 6 deletions drivers/tty/n_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ static size_t __process_echoes(struct tty_struct *tty)
* data at the tail to prevent a subsequent overrun */
while (ldata->echo_commit - tail >= ECHO_DISCARD_WATERMARK) {
if (echo_buf(ldata, tail) == ECHO_OP_START) {
if (echo_buf(ldata, tail) == ECHO_OP_ERASE_TAB)
if (echo_buf(ldata, tail + 1) == ECHO_OP_ERASE_TAB)
tail += 3;
else
tail += 2;
Expand Down Expand Up @@ -1998,7 +1998,10 @@ static int canon_copy_from_read_buf(struct tty_struct *tty,
found = 1;

size = N_TTY_BUF_SIZE - tail;
n = (found + eol + size) & (N_TTY_BUF_SIZE - 1);
n = eol - tail;
if (n > 4096)
n += 4096;
n += found;
c = n;

if (found && read_buf(ldata, eol) == __DISABLED_CHAR) {
Expand Down Expand Up @@ -2243,18 +2246,19 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
if (time)
timeout = time;
}
mutex_unlock(&ldata->atomic_read_lock);
remove_wait_queue(&tty->read_wait, &wait);
n_tty_set_room(tty);
up_read(&tty->termios_rwsem);

remove_wait_queue(&tty->read_wait, &wait);
if (!waitqueue_active(&tty->read_wait))
ldata->minimum_to_wake = minimum;

mutex_unlock(&ldata->atomic_read_lock);

__set_current_state(TASK_RUNNING);
if (b - buf)
retval = b - buf;

n_tty_set_room(tty);
up_read(&tty->termios_rwsem);
return retval;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/serial/8250/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ config SERIAL_8250_DEPRECATED_OPTIONS
accept kernel parameters in both forms like 8250_core.nr_uarts=4 and
8250.nr_uarts=4. We now renamed the module back to 8250, but if
anybody noticed in 3.7 and changed their userspace we still have to
keep the 8350_core.* options around until they revert the changes
keep the 8250_core.* options around until they revert the changes
they already did.

If 8250 is built as a module, this adds 8250_core alias instead.
Expand Down
3 changes: 3 additions & 0 deletions drivers/tty/serial/pmac_zilog.c
Original file line number Diff line number Diff line change
Expand Up @@ -2052,6 +2052,9 @@ static int __init pmz_console_init(void)
/* Probe ports */
pmz_probe();

if (pmz_ports_count == 0)
return -ENODEV;

/* TODO: Autoprobe console based on OF */
/* pmz_console.index = i; */
register_console(&pmz_console);
Expand Down
1 change: 1 addition & 0 deletions drivers/tty/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2086,6 +2086,7 @@ static int tty_open(struct inode *inode, struct file *filp)
filp->f_op = &tty_fops;
goto retry_open;
}
clear_bit(TTY_HUPPED, &tty->flags);
tty_unlock(tty);


Expand Down

0 comments on commit 682a251

Please sign in to comment.