Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit c5be9bc

Browse files
SherrySun5gregkh
authored andcommitted
tty: serial: fsl_lpuart: Clear the error flags by writing 1 for lpuart32 platforms
commit 2820698 upstream. Do not read the data register to clear the error flags for lpuart32 platforms, the additional read may cause the receive FIFO underflow since the DMA has already read the data register. Actually all lpuart32 platforms support write 1 to clear those error bits, let's use this method to better clear the error flags. Fixes: 42b6876 ("serial: fsl_lpuart: DMA support for 32-bit variant") Cc: stable <stable@kernel.org> Signed-off-by: Sherry Sun <sherry.sun@nxp.com> Link: https://lore.kernel.org/r/20230801022304.24251-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f40e70d commit c5be9bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/tty/serial/fsl_lpuart.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,8 +1137,8 @@ static void lpuart_copy_rx_to_tty(struct lpuart_port *sport)
11371137
unsigned long sr = lpuart32_read(&sport->port, UARTSTAT);
11381138

11391139
if (sr & (UARTSTAT_PE | UARTSTAT_FE)) {
1140-
/* Read DR to clear the error flags */
1141-
lpuart32_read(&sport->port, UARTDATA);
1140+
/* Clear the error flags */
1141+
lpuart32_write(&sport->port, sr, UARTSTAT);
11421142

11431143
if (sr & UARTSTAT_PE)
11441144
sport->port.icount.parity++;

0 commit comments

Comments
 (0)