Linux Serial subsystem development
 help / color / mirror / Atom feed
* [PATCH] tty: serial: fsl_lpuart: Fix lpuart_flush_buffer()
@ 2019-10-04 21:55 Andrey Smirnov
  2019-10-04 21:55 ` Andrey Smirnov
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Andrey Smirnov @ 2019-10-04 21:55 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Andrey Smirnov, Stefan Agner, Andrew Lunn, Vivien Didelot,
	Chris Healy, Cory Tusar, Lucas Stach, Jiri Slaby, linux-imx,
	linux-serial, linux-kernel

Fix incorrect read-modify-write sequence in lpuart_flush_buffer() that
was reading from UARTPFIFO and writing to UARTCFIFO instead of
operating solely on the latter.

Fixes: 9bc19af9dacb ("tty: serial: fsl_lpuart: Flush HW FIFOs in .flush_buffer")
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Stefan Agner <stefan@agner.ch>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Vivien Didelot <vivien.didelot@gmail.com>
Cc: Chris Healy <cphealy@gmail.com>
Cc: Cory Tusar <cory.tusar@zii.aero>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: linux-imx@nxp.com
Cc: linux-serial@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---

Greg:

This bug causes occasional boot hang on 5.4-rc1 on Vybrid, so it might
be good to push that for 5.4-rc2.

Thanks,
Andrey Sirnov

 drivers/tty/serial/fsl_lpuart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 3e17bb8a0b16..537896c4d887 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -548,7 +548,7 @@ static void lpuart_flush_buffer(struct uart_port *port)
 		val |= UARTFIFO_TXFLUSH | UARTFIFO_RXFLUSH;
 		lpuart32_write(&sport->port, val, UARTFIFO);
 	} else {
-		val = readb(sport->port.membase + UARTPFIFO);
+		val = readb(sport->port.membase + UARTCFIFO);
 		val |= UARTCFIFO_TXFLUSH | UARTCFIFO_RXFLUSH;
 		writeb(val, sport->port.membase + UARTCFIFO);
 	}
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-10-05  0:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-04 21:55 [PATCH] tty: serial: fsl_lpuart: Fix lpuart_flush_buffer() Andrey Smirnov
2019-10-04 21:55 ` Andrey Smirnov
2019-10-04 22:06 ` Fabio Estevam
2019-10-04 22:06   ` Fabio Estevam
2019-10-04 22:53 ` Andrew Lunn
2019-10-04 22:53   ` Andrew Lunn
2019-10-05  0:12 ` Vivien Didelot
2019-10-05  0:12   ` Vivien Didelot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox