diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-29 21:44:13 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-29 21:44:13 -0400 |
commit | 4ceedcf8151c1b91ad45a2603d4473c0ad3ac03c (patch) | |
tree | 3282387ff7ac6fd108a119417bd1f93c018fed1a /drivers/tty/serial | |
parent | 058555739166561b97313123521574f0a9b2c9d7 (diff) | |
parent | 15c03dd4859ab16f9212238f29dd315654aa94f6 (diff) |
Merge 3.12-rc3 into tty-next
We want the tty/serial fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r-- | drivers/tty/serial/pch_uart.c | 13 | ||||
-rw-r--r-- | drivers/tty/serial/serial-tegra.c | 4 |
2 files changed, 6 insertions, 11 deletions
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c index e0fbf87478b9..87f25def0b41 100644 --- a/drivers/tty/serial/pch_uart.c +++ b/drivers/tty/serial/pch_uart.c | |||
@@ -667,30 +667,21 @@ static int pop_tx_x(struct eg20t_port *priv, unsigned char *buf) | |||
667 | 667 | ||
668 | static int dma_push_rx(struct eg20t_port *priv, int size) | 668 | static int dma_push_rx(struct eg20t_port *priv, int size) |
669 | { | 669 | { |
670 | struct tty_struct *tty; | ||
671 | int room; | 670 | int room; |
672 | struct uart_port *port = &priv->port; | 671 | struct uart_port *port = &priv->port; |
673 | struct tty_port *tport = &port->state->port; | 672 | struct tty_port *tport = &port->state->port; |
674 | 673 | ||
675 | port = &priv->port; | ||
676 | tty = tty_port_tty_get(tport); | ||
677 | if (!tty) { | ||
678 | dev_dbg(priv->port.dev, "%s:tty is busy now", __func__); | ||
679 | return 0; | ||
680 | } | ||
681 | |||
682 | room = tty_buffer_request_room(tport, size); | 674 | room = tty_buffer_request_room(tport, size); |
683 | 675 | ||
684 | if (room < size) | 676 | if (room < size) |
685 | dev_warn(port->dev, "Rx overrun: dropping %u bytes\n", | 677 | dev_warn(port->dev, "Rx overrun: dropping %u bytes\n", |
686 | size - room); | 678 | size - room); |
687 | if (!room) | 679 | if (!room) |
688 | return room; | 680 | return 0; |
689 | 681 | ||
690 | tty_insert_flip_string(tport, sg_virt(&priv->sg_rx), size); | 682 | tty_insert_flip_string(tport, sg_virt(&priv->sg_rx), size); |
691 | 683 | ||
692 | port->icount.rx += room; | 684 | port->icount.rx += room; |
693 | tty_kref_put(tty); | ||
694 | 685 | ||
695 | return room; | 686 | return room; |
696 | } | 687 | } |
@@ -1098,6 +1089,8 @@ static void pch_uart_err_ir(struct eg20t_port *priv, unsigned int lsr) | |||
1098 | if (tty == NULL) { | 1089 | if (tty == NULL) { |
1099 | for (i = 0; error_msg[i] != NULL; i++) | 1090 | for (i = 0; error_msg[i] != NULL; i++) |
1100 | dev_err(&priv->pdev->dev, error_msg[i]); | 1091 | dev_err(&priv->pdev->dev, error_msg[i]); |
1092 | } else { | ||
1093 | tty_kref_put(tty); | ||
1101 | } | 1094 | } |
1102 | } | 1095 | } |
1103 | 1096 | ||
diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c index d0d972f7e43e..0489a2bdcdf9 100644 --- a/drivers/tty/serial/serial-tegra.c +++ b/drivers/tty/serial/serial-tegra.c | |||
@@ -732,7 +732,7 @@ static irqreturn_t tegra_uart_isr(int irq, void *data) | |||
732 | static void tegra_uart_stop_rx(struct uart_port *u) | 732 | static void tegra_uart_stop_rx(struct uart_port *u) |
733 | { | 733 | { |
734 | struct tegra_uart_port *tup = to_tegra_uport(u); | 734 | struct tegra_uart_port *tup = to_tegra_uport(u); |
735 | struct tty_struct *tty = tty_port_tty_get(&tup->uport.state->port); | 735 | struct tty_struct *tty; |
736 | struct tty_port *port = &u->state->port; | 736 | struct tty_port *port = &u->state->port; |
737 | struct dma_tx_state state; | 737 | struct dma_tx_state state; |
738 | unsigned long ier; | 738 | unsigned long ier; |
@@ -744,6 +744,8 @@ static void tegra_uart_stop_rx(struct uart_port *u) | |||
744 | if (!tup->rx_in_progress) | 744 | if (!tup->rx_in_progress) |
745 | return; | 745 | return; |
746 | 746 | ||
747 | tty = tty_port_tty_get(&tup->uport.state->port); | ||
748 | |||
747 | tegra_uart_wait_sym_time(tup, 1); /* wait a character interval */ | 749 | tegra_uart_wait_sym_time(tup, 1); /* wait a character interval */ |
748 | 750 | ||
749 | ier = tup->ier_shadow; | 751 | ier = tup->ier_shadow; |