NetBSD Problem Report #29612
From is@beverly.kleinbus.org Sun Mar 6 19:26:24 2005
Return-Path: <is@beverly.kleinbus.org>
Received: from beverly.kleinbus.org (p508E3AF0.dip.t-dialin.net [80.142.58.240])
by narn.netbsd.org (Postfix) with ESMTP id 1FC4863B104
for <gnats-bugs@gnats.netbsd.org>; Sun, 6 Mar 2005 19:26:18 +0000 (UTC)
Message-Id: <20050306175142.B1A02ECA3@beverly.kleinbus.org>
Date: Sun, 6 Mar 2005 18:51:42 +0100 (CET)
From: is@beverly.kleinbus.org
Reply-To: is@beverly.kleinbus.org
To: gnats-bugs@netbsd.org
Subject: com console on Soekris Net4501 is delayed...
X-Send-Pr-Version: 3.95
>Number: 29612
>Category: kern
>Synopsis: com console on Soekris Net4501 is delayed.
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: jmcneill
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Mar 06 19:27:00 +0000 2005
>Closed-Date: Sat Nov 11 22:56:42 +0000 2006
>Last-Modified: Sat Dec 01 17:50:00 +0000 2007
>Originator: is@beverly.kleinbus.org
>Release: NetBSD 2.0
>Organization:
none.
>Environment:
System: NetBSD netgw 2.0 NetBSD 2.0 (NETGW) #3: Sun Mar 6 14:02:49
UTC 2005 ignatios@sinus:/usr/local/src/2.0/oi/sys/arch/i386/compile/NETGW i386
Architecture: i386
Machine: i386
dmesg extract:
cpu0 at mainbus0: (uniprocessor)
cpu0: AMD Am5x86 W/B 133/160 (486-class), id 0x4f4
cpu0: features 1<FPU>
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
elansc0 at pci0 dev 0 function 0: AMD Elan SC520 System Controller
elansc0: product 0 stepping 0.1, CPU clock 133MHz
...
isa0 at mainbus0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com0: console
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
Full dmesg available on request.
>Description:
On a Soekris 4501, 2.0 kernels--- either NET4501 (with IPSec added)
or netbsd-INSTALL.gz --- only display the next bunch of output
(next character when typing at the command line, next couple of
lines when a command outputs a lot of text) after sending a character
to the machine.
>How-To-Repeat:
boot it. Try to control it via a Transtec VT220 clone.
>Fix:
Workaround:
Changing dev/ic/com.c to either 1.224 (unchanged) or to
1.224.2.2 with this patch makes com0 work again:
Index: com.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/com.c,v
retrieving revision 1.224.2.2
diff -u -r1.224.2.2 com.c
--- com.c 5 Jul 2004 21:57:45 -0000 1.224.2.2
+++ com.c 6 Mar 2005 17:23:35 -0000
@@ -1745,7 +1745,7 @@
bus_space_write_1(iot, ioh, com_ier, sc->sc_ier);
}
-#if 0
+#if 1
/* Output the first chunk of the contiguous buffer. */
if (!ISSET(sc->sc_hwflags, COM_HW_NO_TXPRELOAD)) {
u_int n;
>Release-Note:
>Audit-Trail:
From: David Laight <david@l8s.co.uk>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: kern/29612: com console on Soekris Net4501 is delayed...
Date: Mon, 7 Mar 2005 21:53:11 +0000
On Sun, Mar 06, 2005 at 07:27:00PM +0000, ignatios@beverly.kleinbus.org wrote:
> >Synopsis: com console on Soekris Net4501 is delayed.
> >Description:
> On a Soekris 4501, 2.0 kernels--- either NET4501 (with IPSec added)
> or netbsd-INSTALL.gz --- only display the next bunch of output
> (next character when typing at the command line, next couple of
> lines when a command outputs a lot of text) after sending a character
> to the machine.
There was talk on irc about a 'known problem' with that hardware that
causes the 'transmit holding register empty' bit in the LSR to be
delayed by one bit time WRT the equivalent status in the 'interrupt
status register'. This would cause output to stop - especially at
low baud rates - not the observered behaviour.
The lack of a 'THR empty' interrupt when the interrupt is enabled while
the THR is empty is a different problem.
The 'krupps' problem is caused by the delays between writing to the
transmit fifo and the uart actually removing its interrupt request.
With a fast machine, a small fifo and write posting (pci bus and/or
sparc cpu) this is actually quite likely.
I'd be tempted to:
- keep a count of the number of bytes written since the fifo was last
known to be empty.
- only enable the tx interrupt if there isn't space in the fifo for all
the data queued to be tr4ansmitted
- treat the TXRDY ISR value as an indication that the fifo is empty
(no reason to waste cpu cycles reading the LSR)
However I don't think I've any broken hardware - unledd the soekris 4801
behaves that way....
David
--
David Laight: david@l8s.co.uk
From: "Charles M. Hannum" <abuse@spamalicious.com>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: kern/29612: com console on Soekris Net4501 is delayed...
Date: Mon, 7 Mar 2005 22:05:12 +0000
On Monday 07 March 2005 21:47, David Laight wrote:
> - keep a count of the number of bytes written since the fifo was last
> known to be empty.
> - only enable the tx interrupt if there isn't space in the fifo for all
> the data queued to be tr4ansmitted
In general that isn't going to buy you much, if anything.
> - treat the TXRDY ISR value as an indication that the fifo is empty
> (no reason to waste cpu cycles reading the LSR)
There was some further discussion on a Linux mailing list that this behavior
can be problematic. As I understand it, some chips clear the LSR when you
write to the THR long before they clear the interrupt status, so in a number
of situations (particularly with level-triggered interrupts) you can end up
thinking you have another TXRDY interrupt. Although I don't actually
remember any more, this is probably why I implemented it using the LSR in the
first place.
So, "it's not that simple".
From: Thor Lancelot Simon <tls@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: PR/29612 CVS commit: src/sys/dev/ic
Date: Sun, 12 Jun 2005 21:10:47 +0000 (UTC)
Module Name: src
Committed By: tls
Date: Sun Jun 12 21:10:47 UTC 2005
Modified Files:
src/sys/dev/ic: com.c
Log Message:
Revert the part of revision 1.228 that made HW_NO_TXPRELOAD the default:
it appears to break output on the Soekris net4501, which is a rather
popular platform.
This should fix PR kern/29612 -- if not, I will probably revert it again.
To generate a diff of this commit:
cvs rdiff -r1.232 -r1.233 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.
State-Changed-From-To: open->feedback
State-Changed-By: tls@netbsd.org
State-Changed-When: Sun, 12 Jun 2005 21:16:35 +0000
State-Changed-Why:
Recent commit _should_ fix this problem. Put in feedback pending confirmation
from the submitter (if he's running 2.0 or earlier, the change will apply
cleanly to his kernel sources -- it's just the removal of an #if 0 ... #endif.
)
From: Jasper Wallace <jasper@pointless.net>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: PR/29612
Date: Mon, 2 Jan 2006 02:44:42 +0000 (GMT)
Hi,
Trying to install 3.0 on my net4521's has the same problem described here.
The change mentioned in the PR (the #if 0 -> #if 1) fixes the problem for
me.
--
[http://pointless.net/] [0x2ECA0975]
From: Jasper Wallace <jasper@pointless.net>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: kern/29612
Date: Sun, 1 Jan 2006 18:49:34 +0000 (GMT)
Hi,
Trying to install 3.0 on my net4521's has the same problem described here.
The change mentioned in the PR (the #if 0 -> #if 1) fixes the problem for
me.
--
[http://pointless.net/] [0x2ECA0975]
Responsible-Changed-From-To: kern-bug-people->jmcneill
Responsible-Changed-By: jmcneill@netbsd.org
Responsible-Changed-When: Tue, 26 Sep 2006 00:41:57 +0000
Responsible-Changed-Why:
Code inspection indicates that the patch in this PR has been applied. Can you confirm that a 4.0 or -current kernel works?
From: Ignatios Souvatzis <is@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: kern/29612 (com console on Soekris Net4501 is delayed.)
Date: Tue, 26 Sep 2006 17:44:46 +0200
On Tue, Sep 26, 2006 at 12:41:59AM +0000, jmcneill@netbsd.org wrote:
> Synopsis: com console on Soekris Net4501 is delayed.
>
> Responsible-Changed-From-To: kern-bug-people->jmcneill
> Responsible-Changed-By: jmcneill@netbsd.org
> Responsible-Changed-When: Tue, 26 Sep 2006 00:41:57 +0000
> Responsible-Changed-Why:
> Code inspection indicates that the patch in this PR has been applied. Can you confirm that a 4.0 or -current kernel works?
I've wanted to do that for a long time, yes.
I've I can't do that in the next three days, it'll have to wait 'til
after my vacation, however (8 more days)..
Regards,
-is
State-Changed-From-To: feedback->closed
State-Changed-By: is@netbsd.org
State-Changed-When: Sat, 11 Nov 2006 22:56:42 +0000
State-Changed-Why:
works in netbsd-4.
From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: PR/29612 CVS commit: [netbsd-2] src/sys/dev/ic
Date: Sat, 1 Dec 2007 17:38:58 +0000 (UTC)
Module Name: src
Committed By: bouyer
Date: Sat Dec 1 17:38:58 UTC 2007
Modified Files:
src/sys/dev/ic [netbsd-2]: com.c
Log Message:
Pull up following revision(s) (requested by is in ticket #11394):
sys/dev/ic/com.c: revision 1.233
Revert the part of revision 1.228 that made HW_NO_TXPRELOAD the default:
it appears to break output on the Soekris net4501, which is a rather
popular platform.
This should fix PR kern/29612.
To generate a diff of this commit:
cvs rdiff -r1.224.2.2 -r1.224.2.2.2.1 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.
From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: PR/29612 CVS commit: [netbsd-3] src/sys/dev/ic
Date: Sat, 1 Dec 2007 17:49:45 +0000 (UTC)
Module Name: src
Committed By: bouyer
Date: Sat Dec 1 17:49:45 UTC 2007
Modified Files:
src/sys/dev/ic [netbsd-3]: com.c
Log Message:
Pull up following revision(s) (requested by is in ticket #1882):
sys/dev/ic/com.c: revision 1.233
Revert the part of revision 1.228 that made HW_NO_TXPRELOAD the default:
it appears to break output on the Soekris net4501, which is a rather
popular platform.
This should fix PR kern/29612.
To generate a diff of this commit:
cvs rdiff -r1.232 -r1.232.2.1 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.
>Unformatted:
com.c 1.224.2.2
(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.