serial: 8250: 8250_omap: Fix possible interrupt storm on K3 SoCs
authorVignesh Raghavendra <vigneshr@ti.com>
Tue, 22 Jun 2021 14:57:04 +0000 (20:27 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:56:49 +0000 (16:56 +0200)
commit9443acbd251f366804b20a27be72ba67df532cb1
tree4ff702a4fa3ffede47abd06e1c092f6bf6b8c473
parente0e3e0b7dabf9399983c763325bfcd163833085f
serial: 8250: 8250_omap: Fix possible interrupt storm on K3 SoCs

[ Upstream commit b67e830d38fa9335d927fe67e812e3ed81b4689c ]

On K3 family of SoCs (which includes AM654 SoC), it is observed that RX
TIMEOUT is signalled after RX FIFO has been drained, in which case a
dummy read of RX FIFO is required to clear RX TIMEOUT condition.
Otherwise, this would lead to an interrupt storm.

Fix this by introducing UART_RX_TIMEOUT_QUIRK flag and doing a dummy
read in IRQ handler when RX TIMEOUT is reported with no data in RX FIFO.

Fixes: be70874498f3 ("serial: 8250_omap: Add support for AM654 UART controller")
Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
Tested-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Link: https://lore.kernel.org/r/20210622145704.11168-1-vigneshr@ti.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/8250/8250_omap.c