Module Name:    src
Committed By:   martin
Date:           Mon Jan 20 09:24:32 UTC 2025

Modified Files:
        src/sys/dev/ic: com.c

Log Message:
Backout previous, this needs to be done differently


To generate a diff of this commit:
cvs rdiff -u -r1.385 -r1.386 src/sys/dev/ic/com.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/com.c
diff -u src/sys/dev/ic/com.c:1.385 src/sys/dev/ic/com.c:1.386
--- src/sys/dev/ic/com.c:1.385	Mon Jan 20 07:21:29 2025
+++ src/sys/dev/ic/com.c	Mon Jan 20 09:24:32 2025
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.385 2025/01/20 07:21:29 imil Exp $ */
+/* $NetBSD: com.c,v 1.386 2025/01/20 09:24:32 martin Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.385 2025/01/20 07:21:29 imil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.386 2025/01/20 09:24:32 martin Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"
@@ -168,7 +168,6 @@ int	com_to_tiocm(struct com_softc *);
 void	com_iflush(struct com_softc *);
 
 int	com_common_getc(dev_t, struct com_regs *);
-static void	com_txwait(struct com_regs *);
 static void	com_common_putc(dev_t, struct com_regs *, int, int);
 
 int	cominit(struct com_regs *, int, int, int, tcflag_t);
@@ -590,14 +589,8 @@ com_attach_subr(struct com_softc *sc)
 			break;
 		}
 
-		if (vm_guest == VM_GUEST_NO)
-			/* Make sure the console is always "hardwired". */
-			delay(10000); /* wait for output to finish */
-		else {
-			const int s = splserial();
-			com_txwait(regsp);
-			splx(s);
-		}
+		/* Make sure the console is always "hardwired". */
+		delay(10000);			/* wait for output to finish */
 		if (is_console) {
 			SET(sc->sc_hwflags, COM_HW_CONSOLE);
 		}
@@ -2533,20 +2526,10 @@ com_common_getc(dev_t dev, struct com_re
 }
 
 static void
-com_txwait(struct com_regs *regsp)
-{
-	int timo;
-
-	timo = 150000;
-	while (!ISSET(CSR_READ_1(regsp, COM_REG_LSR), LSR_TXRDY) && --timo)
-		continue;
-}
-
-static void
 com_common_putc(dev_t dev, struct com_regs *regsp, int c, int with_readahead)
 {
 	int s = splserial();
-	int cin, stat;
+	int cin, stat, timo;
 
 	if (with_readahead && com_readaheadcount < MAX_READAHEAD
 	     && ISSET(stat = CSR_READ_1(regsp, COM_REG_LSR), LSR_RXRDY)) {
@@ -2558,7 +2541,9 @@ com_common_putc(dev_t dev, struct com_re
 	}
 
 	/* wait for any pending transmission to finish */
-	com_txwait(regsp);
+	timo = 150000;
+	while (!ISSET(CSR_READ_1(regsp, COM_REG_LSR), LSR_TXRDY) && --timo)
+		continue;
 
 	CSR_WRITE_1(regsp, COM_REG_TXDATA, c);
 	COM_BARRIER(regsp, BR | BW);

Reply via email to