diff options
author | Mark Brown <broonie@kernel.org> | 2018-06-19 12:30:52 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-06-19 12:30:52 +0100 |
commit | e7a3b8c9ec4c4901094ed7659ba7f62a6811f3c9 (patch) | |
tree | f9b41240fad08738a6309e9b054b168ce4723f77 /drivers/tty/serial/amba-pl011.c | |
parent | 460d076a1b1cb70f2e7e6c2401b5067e20acc847 (diff) | |
parent | 14c74ac318a8fe6dd6e13ddc93a5b458147a7c4c (diff) |
Merge branch 'linux-linaro-lsk-v4.9' into linux-linaro-lsk-v4.9-rt
Diffstat (limited to 'drivers/tty/serial/amba-pl011.c')
-rw-r--r-- | drivers/tty/serial/amba-pl011.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 7b81b98d1e39..7a5221daf302 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -1726,10 +1726,26 @@ static int pl011_allocate_irq(struct uart_amba_port *uap) */ static void pl011_enable_interrupts(struct uart_amba_port *uap) { + unsigned int i; + spin_lock_irq(&uap->port.lock); /* Clear out any spuriously appearing RX interrupts */ pl011_write(UART011_RTIS | UART011_RXIS, uap, REG_ICR); + + /* + * RXIS is asserted only when the RX FIFO transitions from below + * to above the trigger threshold. If the RX FIFO is already + * full to the threshold this can't happen and RXIS will now be + * stuck off. Drain the RX FIFO explicitly to fix this: + */ + for (i = 0; i < uap->fifosize * 2; ++i) { + if (pl011_read(uap, REG_FR) & UART01x_FR_RXFE) + break; + + pl011_read(uap, REG_DR); + } + uap->im = UART011_RTIM; if (!pl011_dma_rx_running(uap)) uap->im |= UART011_RXIM; |