diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2019-07-29 12:52:10 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-04 12:43:47 +0200 |
commit | 15dd287b28b959d6c16d2f7e49aab75a80749ec8 (patch) | |
tree | d322ba4f2e2f3bddf3543791926d5eb317a06acd | |
parent | 66127ec7e3248f0f1086830fc7e649f1fb0e3b09 (diff) | |
download | linux-stable-15dd287b28b959d6c16d2f7e49aab75a80749ec8.tar.gz linux-stable-15dd287b28b959d6c16d2f7e49aab75a80749ec8.tar.bz2 linux-stable-15dd287b28b959d6c16d2f7e49aab75a80749ec8.zip |
tty: serial: fsl_lpuart: Fix issue in software flow control
Although I haven't observed this bug in practice, it seems that the
code for handling x_char of LPUART is pretty much identical to that of
i.MX. So the fix found in commit 7e2fb5aa8d81 ("serial: imx: Fix issue
in software flow control"):
serial: imx: Fix issue in software flow control
After send out x_char in UART driver, x_char needs to be cleared
by UART driver itself, otherwise data in TXFIFO can no longer be
sent out.
Also tx counter needs to be increased to keep track of correct
number of transmitted data.
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
should apply here as well.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Stefan Agner <stefan@agner.ch>
Cc: Bhuvanchandra DV <bhuvanchandra.dv@toradex.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
Link: https://lore.kernel.org/r/20190729195226.8862-9-andrew.smirnov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/fsl_lpuart.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index c35f81df0cff..8657addbfd1c 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -782,6 +782,8 @@ static void lpuart_txint(struct lpuart_port *sport) lpuart32_write(&sport->port, sport->port.x_char, UARTDATA); else writeb(sport->port.x_char, sport->port.membase + UARTDR); + sport->port.icount.tx++; + sport->port.x_char = 0; goto out; } |