CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]        2026/04/26 03:27:15

Modified files:
        sys/dev/ic     : com.c 

Log message:
Attempt to drain the transmit FIFO before resetting or disabling it such
that output that is currently in the FIFO makes it out.  We already do
this when attaching as a console by using a fixed delay, but not in
compwroff() which runs when userland closes the associated tty.  Instead
of using a fixed delay, look at the LSR_TSRE bit which should get set
if the FIFO (or the itransmit shift register if the FIFO is disabled) is
empty.  Use a fixed timeout such that on hardware with a non-functional
LSR_TSRE bit the loops still terminate.

This should fix issues where we lose serial output when userland closes
a tty or when com(4) attaches to the port that is used as the console.

ok deraadt@

Reply via email to