Skip to content

Commit

Permalink
serial: pl011: Do not clear RX FIFO & RX interrupt in unthrottle.
Browse files Browse the repository at this point in the history
[ Upstream commit 032d5a7 ]

Clearing the RX FIFO will cause data loss.
Copy the pl011_enabl_interrupts implementation, and remove the clear
interrupt and FIFO part of the code.

Fixes: 211565b ("serial: pl011: UPSTAT_AUTORTS requires .throttle/unthrottle")
Signed-off-by: delisun <delisun@pateo.com.cn>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20221110020108.7700-1-delisun@pateo.com.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
delisun authored and gregkh committed Dec 31, 2022
1 parent 64bc5db commit 898a162
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion drivers/tty/serial/amba-pl011.c
Original file line number Diff line number Diff line change
Expand Up @@ -1831,8 +1831,17 @@ static void pl011_enable_interrupts(struct uart_amba_port *uap)
static void pl011_unthrottle_rx(struct uart_port *port)
{
struct uart_amba_port *uap = container_of(port, struct uart_amba_port, port);
unsigned long flags;

pl011_enable_interrupts(uap);
spin_lock_irqsave(&uap->port.lock, flags);

uap->im = UART011_RTIM;
if (!pl011_dma_rx_running(uap))
uap->im |= UART011_RXIM;

pl011_write(uap->im, uap, REG_IMSC);

spin_unlock_irqrestore(&uap->port.lock, flags);
}

static int pl011_startup(struct uart_port *port)
Expand Down

0 comments on commit 898a162

Please sign in to comment.