Subject: Re: Keyboard Difficulties revisited
To: None <tech-kern@netbsd.org>
From: Matthew Fincham <matthewf@cat.co.za>
List: tech-kern
Date: 12/18/2001 10:27:11
> If you're using -current, make sure that you have the following revision
> of sys/dev/pckbc/pckbd.c:
>
> /* $NetBSD: pckbd.c,v 1.29 2001/12/09 13:42:01 fvdl Exp $ */
>
> It fixes a serious keyboard probing problem. If that doesn't help,
> posting a log of the events sounds useful. If it's not 10,000 lines
> long that is :)

I tried using the updated file, but the problem stubbonly persists.

Here is the log of events. Again, it is in 3 sections: with mouse and
keyboard plugged in, with mouse and keboard plugged in but with switchbox
switched to another port, and without keyboard plugged in.

1. Mouse and Keyboard Plugged In
========================
This is the working, standard case.

restart

pckbc0 at isa0 port 0x60-0x64
pckbdprobe: START
pckbdprobe: flush any garbage
pckbc_flush: Start flush
pckbc_flush: End flush
pckbdprobe: reset the keyboard
pckbc_poll_cmd1: start
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pkbc_poll_cmd1: i=100
pckbc_poll_data1: returning 170
pkbbc_poll_cmd1: result of poll=170
pckbdprobe: flush again
pckbc_flush: Start flush
pckbc_flush: End flush
pckbd_set_xtscancode: - START
pckbd_set_xtscancode: 8042 is translating->use AT codes
pckbc_poll_cmd1: start
pckbc_send_devcmd: 240
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pckbc_send_devcmd: 2
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pmsprobe: start
pmsiprobe: start pmsi probe
pckbd0 at pckbc0 (kbd slot)
pckbdattach: Start
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pckbc_poll_data1: returning 0
pckbdprobe: START
pmsprobe: start
pmsprobe: flush any garbage
pckbc_flush: Start flush
pckbc_flush: End flush
pmsprobe: flush complete
pmsprobe: reset the device
pckbc_poll_cmd1: start
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pkbc_poll_cmd1: i=100
pckbc_poll_data1: returning 170
pkbbc_poll_cmd1: result of poll=170
pkbc_poll_cmd1: i=100
pckbc_poll_data1: returning 0
pkbbc_poll_cmd1: result of poll=0
pmsprobe: reset successful
pmsprobe: returning 10
pmsiprobe: start pmsi probe
pmsiprobe: flush any garbage
pckbc_flush: Start flush
pckbc_flush: End flush
pmsiprobe: flush complete
pmsiprobe: reset device
pckbc_poll_cmd1: start
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pkbc_poll_cmd1: i=100
pckbc_poll_data1: returning 170
pkbbc_poll_cmd1: result of poll=170
pkbc_poll_cmd1: i=100
pckbc_poll_data1: returning 0
pkbbc_poll_cmd1: result of poll=0
pmsiprobe: reset complete
pckbc_poll_cmd1: start
pckbc_send_devcmd: 243
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pckbc_send_devcmd: 200
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pckbc_poll_cmd1: start
pckbc_send_devcmd: 243
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pckbc_send_devcmd: 100
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pckbc_poll_cmd1: start
pckbc_send_devcmd: 243
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pckbc_send_devcmd: 80
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pckbc_poll_cmd1: start
pckbc_send_devcmd: 242
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pkbc_poll_cmd1: i=10
pckbc_poll_data1: returning 0
pkbbc_poll_cmd1: result of poll=0
pms0 at pckbc0 (aux slot)
pckbc_flush: Start flush
pckbc_flush: End flush
pckbc_poll_cmd1: start
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pkbc_poll_cmd1: i=100
pckbc_poll_data1: returning 170
pkbbc_poll_cmd1: result of poll=170
pkbc_poll_cmd1: i=100
pckbc_poll_data1: returning 0
pkbbc_poll_cmd1: result of poll=0
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0wsmouse_attach: start
mux 0wsmouse_attach: end

pckbc_poll_cmd1: start
pckbc_send_devcmd: 245
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK

# And then on the first key press
pckbc_send_devcmd: 237
pckbc_send_devcmd: 0


2. Mouse And Keyboard Plugged in, Switchbox to another Port
===========================================
This is the case where things fail. The machine is booted up in this state,
and then the switchbox is switched to the booted machine. The keyboard does
not work.

restart

pckbc0 at isa0 port 0x60-0x64
pckbdprobe: START
pckbdprobe: flush any garbage
pckbc_flush: Start flush
pckbc_flush: End flush
pckbdprobe: reset the keyboard
pckbc_poll_cmd1: start
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 254
pckbc_poll_cmd1: RESEND
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 254
pckbc_poll_cmd1: RESEND
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 254
pckbc_poll_cmd1: RESEND
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 254
pckbc_poll_cmd1: RESEND
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 254
pckbc_poll_cmd1: RESEND
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 254
pckbc_poll_cmd1: RESEND
pckbc_poll_cmd1: cmd failed
pckbdprobe: reset error 5 - probably no keyboard connected
pmsprobe: start
pmsiprobe: start pmsi probe
pckbd0 at pckbc0 (kbd slot)
pckbdattach: Start
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pckbc_poll_data1: returning 0
pckbdprobe: START
pmsprobe: start
pmsprobe: flush any garbage
pckbc_flush: Start flush
pckbc_flush: End flush
pmsprobe: flush complete
pmsprobe: reset the device
pckbc_poll_cmd1: start
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pkbc_poll_cmd1: i=100
pkbbc_poll_cmd1: result of poll=-1
pckbc_poll_cmd1: no data
pmsprobe: reset error 60
pmsiprobe: start pmsi probe
pmsiprobe: flush any garbage
pckbc_flush: Start flush
pckbc_flush: End flush
pmsiprobe: flush complete
pmsiprobe: reset device
pckbc_poll_cmd1: start
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pkbc_poll_cmd1: i=100
pkbbc_poll_cmd1: result of poll=-1
pckbc_poll_cmd1: no data



3. No Keyboard Plugged In
===================
This is the case where the keyboard is plugged in after boot-up, and works.
It essentially removes the switchbox from the equation.

restart

pckbc0 at isa0 port 0x60-0x64
pckbdprobe: START
pckbdprobe: flush any garbage
pckbc_flush: Start flush
pckbc_flush: End flush
pckbdprobe: reset the keyboard
pckbc_poll_cmd1: start
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 254
pckbc_poll_cmd1: RESEND
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 254
pckbc_poll_cmd1: RESEND
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 254
pckbc_poll_cmd1: RESEND
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 254
pckbc_poll_cmd1: RESEND
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 254
pckbc_poll_cmd1: RESEND
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 254
pckbc_poll_cmd1: RESEND
pckbc_poll_cmd1: cmd failed
pckbdprobe: reset error 5 - probably no keyboard connected
pmsprobe: start
pmsiprobe: start pmsi probe
pckbd0 at pckbc0 (kbd slot)
pckbdattach: Start
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pckbc_poll_data1: returning 0
pckbdprobe: START
pmsprobe: start
pmsprobe: flush any garbage
pckbc_flush: Start flush
pckbc_flush: End flush
pmsprobe: flush complete
pmsprobe: reset the device
pckbc_poll_cmd1: start
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pkbc_poll_cmd1: i=100
pckbc_poll_data1: returning 170
pkbbc_poll_cmd1: result of poll=170
pkbc_poll_cmd1: i=100
pckbc_poll_data1: returning 0
pkbbc_poll_cmd1: result of poll=0
pmsprobe: reset successful
pmsprobe: returning 10
pmsiprobe: start pmsi probe
pmsiprobe: flush any garbage
pckbc_flush: Start flush
pckbc_flush: End flush
pmsiprobe: flush complete
pmsiprobe: reset device
pckbc_poll_cmd1: start
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pkbc_poll_cmd1: i=100
pckbc_poll_data1: returning 170
pkbbc_poll_cmd1: result of poll=170
pkbc_poll_cmd1: i=100
pckbc_poll_data1: returning 0
pkbbc_poll_cmd1: result of poll=0
pmsiprobe: reset complete
pckbc_poll_cmd1: start
pckbc_send_devcmd: 243
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pckbc_send_devcmd: 200
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pckbc_poll_cmd1: start
pckbc_send_devcmd: 243
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pckbc_send_devcmd: 100
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pckbc_poll_cmd1: start
pckbc_send_devcmd: 243
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pckbc_send_devcmd: 80
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pckbc_poll_cmd1: start
pckbc_send_devcmd: 242
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pkbc_poll_cmd1: i=10
pckbc_poll_data1: returning 0
pkbbc_poll_cmd1: result of poll=0
pms0 at pckbc0 (aux slot)
pckbc_flush: Start flush
pckbc_flush: End flush
pckbc_poll_cmd1: start
pckbc_send_devcmd: 255
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK
pkbc_poll_cmd1: i=100
pckbc_poll_data1: returning 170
pkbbc_poll_cmd1: result of poll=170
pkbc_poll_cmd1: i=100
pckbc_poll_data1: returning 0
pkbbc_poll_cmd1: result of poll=0
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0wsmouse_attach: start
mux 0wsmouse_attach: end

pckbc_poll_cmd1: start
pckbc_send_devcmd: 245
pckbc_poll_cmd1: cmd sent
pckbc_poll_data1: returning 250
pckbc_poll_cmd1: KBC_DEVCMD_ACK

# And then when the keyboard is plugged in
pckbc_send_devcmd: 237
pckbc_send_devcmd: 0



In both case 2 and case 3, the keyboard is correctly assumed to not be
plugged in. The difference seems to be in the probing of the mouse. Now this
seems particularly strange, as the switchbox is just a keyboard/monitor
switch. The mouse is constantly plugged in.

Thank you to anyone who has looked at this. If there are any suggestions for
where to probe further, they would be appreciated.

Thank you.
Matthew Fincham