Subject: Re: ps/2 mouse timeout problems
To: David Laight <david@l8s.co.uk>
From: Martin Husemann <martin@duskware.de>
List: tech-kern
Date: 08/30/2002 15:33:22
On Fri, Aug 30, 2002 at 12:20:44AM +0100, David Laight wrote:

> The ps/2 driver seems to call microtime() (possibly unknowingly)
> in order to (I presume) timestamp the arrival of bytes.

Yes. And it needs higher precision than mono_time can provide.

> Now the standard microtime() routine will always enable
> interrupts on exit (even if disabled on entry), it is definitely
> called with interrupts disabled from somewhere.

Since pmsinput is called from pckbcintr, which is a regular interrupt
handler, we will not have cli'd, so the sti in microtime does no harm.

> It is also worth noting that (on x86) microtime() is a particularly
> expensive routine (about 4us at best), so using the callout
> functions is significantly better (they are optimised for short
> timers, even when cancelled).

That is indeed an alternative. I'll have a look at it.

Martin