NetBSD Problem Report #4373

Received: (qmail 18968 invoked from network); 29 Oct 1997 00:37:04 -0000
Message-Id: <199710290036.SAA02173@dahan.metonymy.com>
Date: Tue, 28 Oct 1997 18:36:16 -0600 (CST)
From: Dave Huang <khym@bga.com>
Reply-To: khym@bga.com
To: gnats-bugs@gnats.netbsd.org
Subject: Probe for 16650 UART breaks if com port is console
X-Send-Pr-Version: 3.95

>Number:         4373
>Category:       kern
>Synopsis:       Probe for 16650 UART breaks if com port is console
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    drochner
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 28 16:50:05 +0000 1997
>Closed-Date:    Wed Oct 29 18:29:52 +0000 1997
>Last-Modified:  Wed Oct 29 18:32:45 +0000 1997
>Originator:     Dave Huang
>Release:        NetBSD 1.3_ALPHA as of October 28, 1997
>Organization:
Name: Dave Huang     |   Mammal, mammal / their names are called /
INet: khym@bga.com   |   they raise a paw / the bat, the cat /
FurryMUCK: Dahan     |   dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 21 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++
>Environment:

System: NetBSD dahan.metonymy.com 1.3_ALPHA NetBSD 1.3_ALPHA (SPIFF) #146: Mon Oct 27 23:25:58 CST 1997 khym@dahan.metonymy.com:/usr/src.local/sys/arch/i386/compile/SPIFF i386


>Description:
	The 16650 probe prints the UART type before restoring the LCR
to a sane value. If the com port being probed happens to be the
console, this garbles the console output. Noticed by Michael
Richardson <mcr@sandelman.ottawa.on.ca> (see the bottom of PR #3844)
and myself.
>How-To-Repeat:
	Build a kernel with COM16650 and serial console and watch the
console output turn into garbage when the console gets probed.
>Fix:
--- /usr/src/sys/dev/ic/com.c	Tue Oct 21 03:19:14 1997
+++ com.c	Thu Oct 23 20:29:36 1997
@@ -444,22 +444,23 @@
 				if (bus_space_read_1(iot, ioh, com_efr) == 0) {
 					CLR(sc->sc_hwflags, COM_HW_FIFO);
 					sc->sc_fifolen = 0;
-					printf(": st16650, broken fifo\n");
 				} else {
 					SET(sc->sc_hwflags, COM_HW_FLOW);
-					printf(": st16650a, working fifo\n");
 					sc->sc_fifolen = 32;
 				}
 			} else
 #endif
-			{
-				printf(": ns16550a, working fifo\n");
 				sc->sc_fifolen = 16;
-			}

 #ifdef COM16650
 			bus_space_write_1(iot, ioh, com_lcr, LCR_8BITS);
+			if (sc->sc_fifolen == 0)
+				printf(": st16650, broken fifo\n");
+			else if (sc->sc_fifolen == 32)
+				printf(": st16650a, working fifo\n");
+			else
 #endif
+				printf(": ns16550a, working fifo\n");
 		} else
 			printf(": ns16550, broken fifo\n");
 	else

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: drochner 
State-Changed-When: Wed Oct 29 04:53:26 PST 1997 
State-Changed-Why:  
proposed a modification 


Responsible-Changed-From-To: kern-bug-people->drochner 
Responsible-Changed-By: drochner 
Responsible-Changed-When: Wed Oct 29 04:53:26 PST 1997 
Responsible-Changed-Why:  
I'll care about it. 

From: Matthias Drochner <drochner@zelux6.zel.kfa-juelich.de>
To: gnats-bugs@gnats.netbsd.org, khym@bga.com
Cc:  Subject: Re: kern/4373: Probe for 16650 UART breaks if com port is console
Date: Wed, 29 Oct 1997 13:57:28 +0100 (MET)

 Excerpts from netbsd: 28-Oct-97 kern/4373: Probe for 16650 .. Dave
 Huang@bga.com (2235)

 > If the com port being probed happens to be the
 > console, this garbles the console output.

 Worse, it hangs my system.
 Your fix works for me. However, it is not correct to write
 "LCR_8BITS" to the LCR after probing, the serial console
 could be set up with other parameters.
 I changed it to write the previously read value back instead.
 Comments?

 best regards
 Matthias

From: Dave Huang <khym@bga.com>
To: Matthias Drochner <drochner@zelux6.zel.kfa-juelich.de>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/4373: Probe for 16650 UART breaks if com port is console
Date: Wed, 29 Oct 1997 12:15:08 -0600 (CST)

 On Wed, 29 Oct 1997, Matthias Drochner wrote:
 > Worse, it hangs my system.
 > Your fix works for me. However, it is not correct to write
 > "LCR_8BITS" to the LCR after probing, the serial console
 > could be set up with other parameters.
 > I changed it to write the previously read value back instead.
 > Comments?

 Ah yes, I had noticed that too, but forgot about it. Sure, your change
 sounds fine to me! :)

 Name: Dave Huang     |   Mammal, mammal / their names are called /
 INet: khym@bga.com   |   they raise a paw / the bat, the cat /
 FurryMUCK: Dahan     |   dolphin and dog / koala bear and hog -- TMBG
 Dahan: Hani G Y+C 21 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++

State-Changed-From-To: feedback->closed 
State-Changed-By: drochner 
State-Changed-When: Wed Oct 29 10:29:52 PST 1997 
State-Changed-Why:  
fix comitted 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.