linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial: 8250: Fix UART_BUG_TXEN workaround
@ 2015-02-02 20:47 Peter Hurley
  0 siblings, 0 replies; only message in thread
From: Peter Hurley @ 2015-02-02 20:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-serial, linux-kernel, Peter Hurley,
	Dick Hollenbeck

UARTs which do not trigger THRE interrupt if the fifo is already
empty when the interrupt is enabled need tx primed manually. These
UARTs are identified by the UART_BUG_TXEN flag to enable the
required workaround.

However, the current workaround is broken; if the fifo is already
empty but the shifter is still transmitting, then serial8250_tx_chars()
will not be called but no further THRE interrupt will occur, and
tx will stall. The appropriate check is for fifo empty (THRE), not
transmitter empty (TEMT).

Signed-off-by: Dick Hollenbeck <dick@softplc.com>
[pjh: rewrote commit log]
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---
 drivers/tty/serial/8250/8250_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index 285694b..0c61a9b 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -1365,7 +1365,7 @@ static void serial8250_start_tx(struct uart_port *port)
 			unsigned char lsr;
 			lsr = serial_in(up, UART_LSR);
 			up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
-			if (lsr & UART_LSR_TEMT)
+			if (lsr & UART_LSR_THRE)
 				serial8250_tx_chars(up);
 		}
 	}
-- 
2.2.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-02 20:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-02 20:47 [PATCH] serial: 8250: Fix UART_BUG_TXEN workaround Peter Hurley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).