Skip to content

Commit

Permalink
Revert "serial/amba-pl011: Leave the TX IRQ alone when the UART is no…
Browse files Browse the repository at this point in the history
…t open"

This reverts commit f2ee6df.

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>
  • Loading branch information
Dave Martin authored and Greg Kroah-Hartman committed May 9, 2015
1 parent 66cf1d8 commit ec61847
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/tty/serial/amba-pl011.c
Original file line number Diff line number Diff line change
Expand Up @@ -1639,6 +1639,9 @@ static int pl011_startup(struct uart_port *port)

writew(uap->vendor->ifls, uap->port.membase + UART011_IFLS);

/* Assume that TX IRQ doesn't work until we see one: */
uap->tx_irq_seen = 0;

spin_lock_irq(&uap->port.lock);

/* restore RTS and DTR */
Expand Down Expand Up @@ -1702,7 +1705,7 @@ static void pl011_shutdown(struct uart_port *port)
spin_lock_irq(&uap->port.lock);
uap->im = 0;
writew(uap->im, uap->port.membase + UART011_IMSC);
writew(0xffff & ~UART011_TXIS, uap->port.membase + UART011_ICR);
writew(0xffff, uap->port.membase + UART011_ICR);
spin_unlock_irq(&uap->port.lock);

pl011_dma_shutdown(uap);
Expand Down

0 comments on commit ec61847

Please sign in to comment.