Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Dec 1995 23:10:02 -0800 (PST)
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs
Subject:   Re: kern/920: sio output looses chars in fifo on close()
Message-ID:  <199512300710.XAA03929@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/920; it has been noted by GNATS.

From: Bruce Evans <bde@zeta.org.au>
To: FreeBSD-gnats-submit@FreeBSD.ORG, smp@csn.net
Cc:  Subject: Re: kern/920: sio output looses chars in fifo on close()
Date: Sat, 30 Dec 1995 17:57:39 +1100

 >	The sio driver disables the fifo (of 16550 class chips) in
 >        sioclose() -> comhardclose().  This appears to 'loose' characters
 >        currently in the uart.  If the port is open by another process
 >        ( as in "cat > /dev/ttyd4" ) the problem doesn't occur.
 
 ttywait() is supposed to have waited until output has completed (except
 in non-blocking mode).  However, it doesn't because TS_BUSY is cleared
 too early (when all output has been written to the fifo, not when output
 is complete).  This isn't easy to handle correctly since there is no
 interrupt for output-complete.
 
 Output would also be lost or garbled when the line state is changed,
 except comparam() waits for output to complete because some UARTs lock
 up if their speed is changed while they are active.  Some internal
 modems are reported to loop endlessly in the wait in comparam().  This
 may be because they don't [correctly] implement the LSR_TSRE
 (transmitter shift register empty) bit that must be polled to to decide
 when to clear TS_BUSY.
 
 Bruce



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