summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTudor Ambarus <tudor.ambarus@linaro.org>2024-01-19 10:45:08 +0000
committerSasha Levin <sashal@kernel.org>2024-03-26 18:22:02 -0400
commit1639e9c7a3ae7e4ce6b5917aeb2b480d2e3ccf64 (patch)
treec5d33b387cc2c518a2dffab21ae92dc7f094d8ca
parent1eb9ab1f9f20b86e3773ef07dbe49319a23ddc12 (diff)
downloadlinux-1639e9c7a3ae7e4ce6b5917aeb2b480d2e3ccf64.tar.gz
linux-1639e9c7a3ae7e4ce6b5917aeb2b480d2e3ccf64.tar.bz2
linux-1639e9c7a3ae7e4ce6b5917aeb2b480d2e3ccf64.zip
tty: serial: samsung: fix tx_empty() to return TIOCSER_TEMT
[ Upstream commit 314c2b399288f0058a8c5b6683292cbde5f1531b ] The core expects for tx_empty() either TIOCSER_TEMT when the tx is empty or 0 otherwise. s3c24xx_serial_txempty_nofifo() might return 0x4, and at least uart_get_lsr_info() tries to clear exactly TIOCSER_TEMT (BIT(1)). Fix tx_empty() to return TIOCSER_TEMT. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org> Link: https://lore.kernel.org/r/20240119104526.1221243-2-tudor.ambarus@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/tty/serial/samsung_tty.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index fa5b1321d9b1..5388eb7fa0f4 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -922,11 +922,10 @@ static unsigned int s3c24xx_serial_tx_empty(struct uart_port *port)
if ((ufstat & info->tx_fifomask) != 0 ||
(ufstat & info->tx_fifofull))
return 0;
-
- return 1;
+ return TIOCSER_TEMT;
}
- return s3c24xx_serial_txempty_nofifo(port);
+ return s3c24xx_serial_txempty_nofifo(port) ? TIOCSER_TEMT : 0;
}
/* no modem control lines */