Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Sep 2019 02:55:57 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r352861 - stable/12/sys/dev/uart
Message-ID:  <201909290255.x8T2tvMh082189@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sun Sep 29 02:55:57 2019
New Revision: 352861
URL: https://svnweb.freebsd.org/changeset/base/352861

Log:
  MFC r352369: Relax TX draining in ns8250_bus_transmit().
  
  Since TX interrupt is generated when THRE is set, wait for TEMT set means
  wait for full character transmission time.  At low speeds that may take
  awhile, burning CPU time while holding sc_hwmtx lock, also congested.
  
  This is partial revert of r317659.

Modified:
  stable/12/sys/dev/uart/uart_dev_ns8250.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/uart/uart_dev_ns8250.c
==============================================================================
--- stable/12/sys/dev/uart/uart_dev_ns8250.c	Sat Sep 28 23:08:19 2019	(r352860)
+++ stable/12/sys/dev/uart/uart_dev_ns8250.c	Sun Sep 29 02:55:57 2019	(r352861)
@@ -1026,13 +1026,8 @@ ns8250_bus_transmit(struct uart_softc *sc)
 
 	bas = &sc->sc_bas;
 	uart_lock(sc->sc_hwmtx);
-	if (sc->sc_txdatasz > 1) {
-		if ((uart_getreg(bas, REG_LSR) & LSR_TEMT) == 0)
-			ns8250_drain(bas, UART_DRAIN_TRANSMITTER);
-	} else {
-		while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0)
-			DELAY(4);
-	}
+	while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0)
+		DELAY(4);
 	for (i = 0; i < sc->sc_txdatasz; i++) {
 		uart_setreg(bas, REG_DATA, sc->sc_txbuf[i]);
 		uart_barrier(bas);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909290255.x8T2tvMh082189>