summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/imx.c
diff options
context:
space:
mode:
authorSergey Organov <sorganov@gmail.com>2023-02-01 17:26:59 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-08 13:12:05 +0100
commit53701b6d2ce7202cff88943ee812917c896a8e90 (patch)
treead4d8f8523db5f0cf5d48229bf1a25f4bacf0fcd /drivers/tty/serial/imx.c
parent0fbca4798af88c20a2b9e4c98ac762408a24b668 (diff)
serial: imx: stop using USR2 in FIFO reading loop
The chip provides all the needed bits in the URXD0 register that we read anyway for data, so get rid of reading USR2 and use only URXD0 bits instead. Signed-off-by: Sergey Organov <sorganov@gmail.com> Link: https://lore.kernel.org/r/20230201142700.4346-7-sorganov@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/imx.c')
-rw-r--r--drivers/tty/serial/imx.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index c578cdc6d8da..a662f48a2146 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -894,27 +894,21 @@ static irqreturn_t __imx_uart_rxint(int irq, void *dev_id)
struct tty_port *port = &sport->port.state->port;
u32 usr2;
- usr2 = imx_uart_readl(sport, USR2);
-
/* If we received something, check for 0xff flood */
+ usr2 = imx_uart_readl(sport, USR2);
if (usr2 & USR2_RDR)
imx_uart_check_flood(sport, usr2);
- for ( ; usr2 & USR2_RDR; usr2 = imx_uart_readl(sport, USR2)) {
+ while ((rx = imx_uart_readl(sport, URXD0)) & URXD_CHARRDY) {
flg = TTY_NORMAL;
sport->port.icount.rx++;
- rx = imx_uart_readl(sport, URXD0);
-
- if (usr2 & USR2_BRCD) {
- imx_uart_writel(sport, USR2_BRCD, USR2);
- if (uart_handle_break(&sport->port))
- continue;
- }
-
if (unlikely(rx & URXD_ERR)) {
- if (rx & URXD_BRK)
+ if (rx & URXD_BRK) {
sport->port.icount.brk++;
+ if (uart_handle_break(&sport->port))
+ continue;
+ }
else if (rx & URXD_PRERR)
sport->port.icount.parity++;
else if (rx & URXD_FRMERR)