Takashi Iwai 859c86
From 3ddb4ce1e6e3bd112778ab93bbd9092f23a878ec Mon Sep 17 00:00:00 2001
Takashi Iwai 859c86
From: Colin Ian King <colin.king@canonical.com>
Takashi Iwai 859c86
Date: Mon, 26 Apr 2021 11:55:14 +0100
Takashi Iwai 859c86
Subject: [PATCH] serial: tegra: Fix a mask operation that is always true
Takashi Iwai 859c86
Git-commit: 3ddb4ce1e6e3bd112778ab93bbd9092f23a878ec
Takashi Iwai 859c86
Patch-mainline: v5.13-rc4
Takashi Iwai 859c86
References: git-fixes
Takashi Iwai 859c86
Takashi Iwai 859c86
Currently the expression lsr | UART_LSR_TEMT is always true and
Takashi Iwai 859c86
this seems suspect. I believe the intent was to mask lsr with UART_LSR_TEMT
Takashi Iwai 859c86
to check that bit, so the expression should be using the & operator
Takashi Iwai 859c86
instead. Fix this.
Takashi Iwai 859c86
Takashi Iwai 859c86
Fixes: b9c2470fb150 ("serial: tegra: flush the RX fifo on frame error")
Takashi Iwai 859c86
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Takashi Iwai 859c86
Cc: stable <stable@vger.kernel.org>
Takashi Iwai 859c86
Link: https://lore.kernel.org/r/20210426105514.23268-1-colin.king@canonical.com
Takashi Iwai 859c86
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Takashi Iwai 859c86
Acked-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai 859c86
Takashi Iwai 859c86
---
Takashi Iwai 859c86
 drivers/tty/serial/serial-tegra.c | 2 +-
Takashi Iwai 859c86
 1 file changed, 1 insertion(+), 1 deletion(-)
Takashi Iwai 859c86
Takashi Iwai 859c86
diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c
Takashi Iwai 859c86
index bbae072a125d..222032792d6c 100644
Takashi Iwai 859c86
--- a/drivers/tty/serial/serial-tegra.c
Takashi Iwai 859c86
+++ b/drivers/tty/serial/serial-tegra.c
Takashi Iwai 859c86
@@ -338,7 +338,7 @@ static void tegra_uart_fifo_reset(struct tegra_uart_port *tup, u8 fcr_bits)
Takashi Iwai 859c86
 
Takashi Iwai 859c86
 	do {
Takashi Iwai 859c86
 		lsr = tegra_uart_read(tup, UART_LSR);
Takashi Iwai 859c86
-		if ((lsr | UART_LSR_TEMT) && !(lsr & UART_LSR_DR))
Takashi Iwai 859c86
+		if ((lsr & UART_LSR_TEMT) && !(lsr & UART_LSR_DR))
Takashi Iwai 859c86
 			break;
Takashi Iwai 859c86
 		udelay(1);
Takashi Iwai 859c86
 	} while (--tmout);
Takashi Iwai 859c86
-- 
Takashi Iwai 859c86
2.26.2
Takashi Iwai 859c86