Subject: Re: kern/29612: com console on Soekris Net4501 is delayed...
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: David Laight <david@l8s.co.uk>
List: netbsd-bugs
Date: 03/07/2005 21:47:01
The following reply was made to PR kern/29612; it has been noted by GNATS.

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