Subject: Re: tty input flow control with a "silo"
To: Gordon W. Ross <gwr@mc.com>
From: Bill Studenmund <wrstuden@loki.Stanford.EDU>
List: tech-kern
Date: 02/14/1996 12:56:29
> 
> When a tty driver uses an input "silo" (ring buffer?) that is
> emptied into the tty layer by a lower level (soft) interrupt,
> how should input flow control be handled?  The current input
> handler does not try to block input when the silo becomes
> nearly full, so when there is a sufficiently heavy interrupt
> load on the macine, the silo overflows just because the soft
> interrupt has not yet had a chance to copy the input to the
> tty layer, where input flow control is handled.
> 
> Is there a general mechanism for dealing with this problem?

I don't think so. We have the tools (a call-back to set/clear
hardware input flow control lines), but no framework for coordination
of halting.

We effectively have two buffers, the ring (silo?) buffer (inside
the serial port driver code) and the tty buffer. I would think the best
solution would be for input flow control (soft or hard) to get
triggered whenever either buffer gets too full, and get released only
when both buffers are low.

I'm not sure of the best way to achieve the communication needed for this
to work. We'd probably need an additional call-back routine.

I gather that Charles has adding multi-byte character reads to the tty
system somewhere near the top of his to-do list. (sorry that sentence
doesn't read well) Maybe this question can (has been) addressed as part
of this change (since we can't really get multiple bytes if we don't
have an intermediate buffer)?

Thoughts?

Take care,

Bill