Skip to content

Commit

Permalink
Merge tag 'tty-3.12-rc3' 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 serial at tty driver fixes for 3.12-rc3

  The serial driver fixes some kref leaks, documentation is moved to the
  proper places, and the tty and n_tty fixes resolve some reported
  regressions.  There is still one outstanding tty regression fix that
  isn't in here yet, as I want to test it out some more, it will be sent
  for 3.12-rc4 if it checks out"

* tag 'tty-3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  tty: ar933x_uart: move devicetree binding documentation
  tty: Fix SIGTTOU not sent with tcflush()
  n_tty: Fix EOF push index when termios changes
  serial: pch_uart: remove unnecessary tty_port_tty_get
  serial: pch_uart: fix tty-kref leak in dma-rx path
  serial: pch_uart: fix tty-kref leak in rx-error path
  serial: tegra: fix tty-kref leak
  • Loading branch information
torvalds committed Sep 29, 2013
2 parents 31795c4 + 2332575 commit 26c019f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
3 changes: 1 addition & 2 deletions drivers/tty/n_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1758,8 +1758,7 @@ static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
canon_change = (old->c_lflag ^ tty->termios.c_lflag) & ICANON;
if (canon_change) {
bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE);
ldata->line_start = 0;
ldata->canon_head = ldata->read_tail;
ldata->line_start = ldata->canon_head = ldata->read_tail;
ldata->erasing = 0;
ldata->lnext = 0;
}
Expand Down
13 changes: 3 additions & 10 deletions drivers/tty/serial/pch_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,30 +667,21 @@ static int pop_tx_x(struct eg20t_port *priv, unsigned char *buf)

static int dma_push_rx(struct eg20t_port *priv, int size)
{
struct tty_struct *tty;
int room;
struct uart_port *port = &priv->port;
struct tty_port *tport = &port->state->port;

port = &priv->port;
tty = tty_port_tty_get(tport);
if (!tty) {
dev_dbg(priv->port.dev, "%s:tty is busy now", __func__);
return 0;
}

room = tty_buffer_request_room(tport, size);

if (room < size)
dev_warn(port->dev, "Rx overrun: dropping %u bytes\n",
size - room);
if (!room)
return room;
return 0;

tty_insert_flip_string(tport, sg_virt(&priv->sg_rx), size);

port->icount.rx += room;
tty_kref_put(tty);

return room;
}
Expand Down Expand Up @@ -1098,6 +1089,8 @@ static void pch_uart_err_ir(struct eg20t_port *priv, unsigned int lsr)
if (tty == NULL) {
for (i = 0; error_msg[i] != NULL; i++)
dev_err(&priv->pdev->dev, error_msg[i]);
} else {
tty_kref_put(tty);
}
}

Expand Down
4 changes: 3 additions & 1 deletion drivers/tty/serial/serial-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ static irqreturn_t tegra_uart_isr(int irq, void *data)
static void tegra_uart_stop_rx(struct uart_port *u)
{
struct tegra_uart_port *tup = to_tegra_uport(u);
struct tty_struct *tty = tty_port_tty_get(&tup->uport.state->port);
struct tty_struct *tty;
struct tty_port *port = &u->state->port;
struct dma_tx_state state;
unsigned long ier;
Expand All @@ -744,6 +744,8 @@ static void tegra_uart_stop_rx(struct uart_port *u)
if (!tup->rx_in_progress)
return;

tty = tty_port_tty_get(&tup->uport.state->port);

tegra_uart_wait_sym_time(tup, 1); /* wait a character interval */

ier = tup->ier_shadow;
Expand Down
3 changes: 3 additions & 0 deletions drivers/tty/tty_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,9 @@ int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file,
}
return 0;
case TCFLSH:
retval = tty_check_change(tty);
if (retval)
return retval;
return __tty_perform_flush(tty, arg);
default:
/* Try the mode commands */
Expand Down

0 comments on commit 26c019f

Please sign in to comment.