temporary freezes when pressing capslock / numlock

Rick C. Petty rick-freebsd at kiwi-computer.com
Tue May 27 21:01:59 UTC 2008


On Tue, May 27, 2008 at 01:32:10PM -0700, Maksim Yevmenkin wrote:
> 
> right, which (to me) seems to indicate that something is going wrong
> when kbdmux is trying to work on two keyboards (i.e. ukbd and atkbd)
> and one of them (i.e. atkbd) is "not present". the problem, as i see
> it, is that atkbd keyboard is always present even if no physical ps2
> keyboard is connected to the ps2 port.

That's precisely how I see it.

> i understand that people are
> doing this in order to be able to "hot plug" ps2 keyboard (which is a
> bad idea as ps2 port was never designed to be "hot pluggable", imo).

Although not designed as hot pluggable, there's nothing in the technical
specs which should prevent it.  In fact, the specs imply that this is
plausible.  The only issue I know about is when older hardware didn't have
TVS or line driver protection which could blow the serial driver chips (on
either side) for example when both the keyboard and host try to drive the
clock at the same time, but I doubt is a problem with modern hardware.
Also, I believe the spec specifies the proper use of pullup resistors, so
this shouldn't be a problem.

A common complaint I've heard is that some (cheap) keyboards don't respond
with a power-on self test completed (0xAA) when they are initially plugged
in until they receive an initial command from the host.  I've never seen
such a keyboard; most keyboards send 0xAA immediately after power on, IIRC.  

> i suspect that because physical ps2 keyboard is not actually
> present, the atkbd driver will have to timeout  while talking to
> non-present hardware.

Sure, but this timeout shouldn't be ~0.4 seconds.  I believe the spec says
the maximum wait period to tell if the device is nonresponsive is around or
less than 20ms.  Certainly, blocking the entire kernel for the timeout is a
bad thing, especially since the driver should make full use of the
asynchronous onboard keyboard controller.

> so, as a suggestion, please try to specify 0x1 flag to atkbd, i.e. from atkbd(4)
> ...
> 
> and see if this helps. you wont be able to "hot plug" ps2 keyboards,
> but i suspect you probably can live without it.

I'm almost certain this will help, but I believe this shouldn't be the
answer to this problem.  There's no reason atkbdc(4) should block the
entire kernel for any appreciable amount of time.

-- Rick C. Petty


More information about the freebsd-hackers mailing list