lkml.org 
[lkml]   [2000]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Re: Move of input drivers, some word needed from you
From
Date
   Date: Tue, 22 Aug 2000 14:16:51 +0200 (MEST)
From: R.E.Wolff@BitWizard.nl (Rogier Wolff)

The tty layer needs to set termios, and write characters. tty layer
should copy these into the circular buffer without leaving that to the
individual driver. (*) Usually the interrupt routine will just empty
the circular buffer.

Well, the high-level code can offer these services as an option, much
like the VFS layer offers various utility functions to the tty devices,
but not all low-level tty drivers will find this useful.

Now, currently, most of the recieve handling is postponed to the
bottom half. I question the usefulness of this optimization. It
certainly adds latency. What is it that needs to be done on reception
of a few chars? Copy the data to userspace, and hit the waitq of the
process that's waiting for data. If you want to prevent the races, use
a kernel-space circular buffer, and do the processing (copy to
userspace) in the context of the wokenup process.

It does *not* have to be postponed to the bottom half. Take a look at
the rocketport driver. Since it only gets characters out of a large
fifo every clock tick (the hardware doesn't support interrupts, since
for a large number of active ports, polling is more efficient), it
simply calls the line discpline directly.

As I explained earlier, the down side of this is that at 115200 bps, you
will be calling the line discpline 11,520 times a second. On a 40 MHz
386, this became a real bottleneck. On modern CPU's it's less of an
issue, but most of the time you don't care about latency anyway. That's
why I added ASYNC_LOW_LATENCY; it's now configurable whether you care
about latency or not.

Oh, with DCD and stuff, we also need a callback for "modem signals
changed". What to do with that (i.e. unblock someone in open, or
hangup the users shell) should be the tty layer's choice. Not
something that is done in the hardware driver.

That's something I want to do in 2.5 --- move all of the hangup
processing into the high-level tty drivers, instead of have it split
between the high and low-level tty drivers.

- Ted


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:37    [W:0.156 / U:6.368 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site