summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorBibek Basu <bbasu@nvidia.com>2014-04-28 10:59:24 +0530
committerSimone Willett <swillett@nvidia.com>2014-05-13 14:33:58 -0700
commit17fa41423e194410d5270706733e77344aff3a42 (patch)
tree7e0f4d9c86d7eebc43e8d4fd0ebc8bef499033d9 /drivers/tty
parenta6c9ce8f39deb2af976ab3a587182711dae0fc70 (diff)
tty: serial8250: add break handler quirk for tegra
On tegra,after a break is issued, uart status register generates FIFOE error rather than the next character ready status. For that quirk is already present. Hook is added for the quirk so that sysrq key combination works. This helps in debugging soft hangs Bug 1401397 Change-Id: I0131cfc986aba694ddc21d859685748843534611 Signed-off-by: Bibek Basu <bbasu@nvidia.com> Reviewed-on: http://git-master/r/401535 (cherry picked from commit c72b366e010b5cfbac6541eb339a0324b863ff17) Reviewed-on: http://git-master/r/406402 Reviewed-by: Matthew Pedro <mapedro@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/8250/8250_core.c21
-rw-r--r--drivers/tty/serial/of_serial.c22
2 files changed, 21 insertions, 22 deletions
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index 264054fe8a66..5914e7a9ed5a 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -1601,6 +1601,24 @@ static int serial8250_tegra_handle_irq(struct uart_port *port)
return 1;
}
+#ifdef CONFIG_ARCH_TEGRA
+void tegra_serial_handle_break(struct uart_port *p)
+{
+ unsigned int status, tmout = 10000;
+
+ do {
+ status = p->serial_in(p, UART_LSR);
+ if (status & (UART_LSR_FIFOE | UART_LSR_BRK_ERROR_BITS))
+ status = p->serial_in(p, UART_RX);
+ else
+ break;
+ if (--tmout == 0)
+ break;
+ udelay(1);
+ } while (1);
+}
+#endif
+
/*
* These Exar UARTs have an extra interrupt indicator that could
* fire for a few unimplemented interrupts. One of which is a
@@ -2761,6 +2779,9 @@ static void serial8250_config_port(struct uart_port *port, int flags)
if (port->type == PORT_TEGRA) {
up->bugs |= UART_BUG_NOMSR;
port->handle_irq = serial8250_tegra_handle_irq;
+#if defined CONFIG_ARCH_TEGRA
+ port->handle_break = tegra_serial_handle_break;
+#endif
}
if (port->type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ)
diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
index 39c7ea4cb14f..261c0ad164ec 100644
--- a/drivers/tty/serial/of_serial.c
+++ b/drivers/tty/serial/of_serial.c
@@ -29,28 +29,6 @@ struct of_serial_info {
int line;
};
-#ifdef CONFIG_ARCH_TEGRA
-void tegra_serial_handle_break(struct uart_port *p)
-{
- unsigned int status, tmout = 10000;
-
- do {
- status = p->serial_in(p, UART_LSR);
- if (status & (UART_LSR_FIFOE | UART_LSR_BRK_ERROR_BITS))
- status = p->serial_in(p, UART_RX);
- else
- break;
- if (--tmout == 0)
- break;
- udelay(1);
- } while (1);
-}
-#else
-static inline void tegra_serial_handle_break(struct uart_port *port)
-{
-}
-#endif
-
/*
* Fill a struct uart_port for a given device node
*/