aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorDave Martin <Dave.Martin@arm.com>2015-05-08 09:07:50 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-09 12:36:36 -0400
commitec61847855094d6f6144340b26f14203f25dd4e9 (patch)
tree576e0407ff7ab1d5112cf94c7134e61f01c91ab1 /drivers/tty
parent66cf1d8473780fcb1a90e86fd19ba276520deb14 (diff)
Revert "serial/amba-pl011: Leave the TX IRQ alone when the UART is not open"
This reverts commit f2ee6dfa0e8597eea8b98d240b0033994e20d215. Jakub KiciƄski observed that this patch can cause the pl011 driver to hang if if the only process with a pl011 port open is killed by a signal, pl011_shutdown() can get called with an arbitrary amount of data still in the FIFO. Calling _shutdown() with the TX FIFO non-empty is questionable behaviour and my itself be a bug. Since the affected patch was speculative anyway, and brings limited benefit, the simplest course is to remove the assumption that TXIS will always be left asserted after the port is shut down. Signed-off-by: Dave Martin <Dave.Martin@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/amba-pl011.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 5a4e9d579585..6f5a0720a8c8 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -1639,6 +1639,9 @@ static int pl011_startup(struct uart_port *port)
1639 1639
1640 writew(uap->vendor->ifls, uap->port.membase + UART011_IFLS); 1640 writew(uap->vendor->ifls, uap->port.membase + UART011_IFLS);
1641 1641
1642 /* Assume that TX IRQ doesn't work until we see one: */
1643 uap->tx_irq_seen = 0;
1644
1642 spin_lock_irq(&uap->port.lock); 1645 spin_lock_irq(&uap->port.lock);
1643 1646
1644 /* restore RTS and DTR */ 1647 /* restore RTS and DTR */
@@ -1702,7 +1705,7 @@ static void pl011_shutdown(struct uart_port *port)
1702 spin_lock_irq(&uap->port.lock); 1705 spin_lock_irq(&uap->port.lock);
1703 uap->im = 0; 1706 uap->im = 0;
1704 writew(uap->im, uap->port.membase + UART011_IMSC); 1707 writew(uap->im, uap->port.membase + UART011_IMSC);
1705 writew(0xffff & ~UART011_TXIS, uap->port.membase + UART011_ICR); 1708 writew(0xffff, uap->port.membase + UART011_ICR);
1706 spin_unlock_irq(&uap->port.lock); 1709 spin_unlock_irq(&uap->port.lock);
1707 1710
1708 pl011_dma_shutdown(uap); 1711 pl011_dma_shutdown(uap);