kbd0 at both atkbd0 and ukbd0

Andriy Gapon avg at icyb.net.ua
Fri May 15 15:03:48 UTC 2009


on 07/05/2009 17:17 Helmut Schneider said the following:
> Andriy Gapon <avg at icyb.net.ua> wrote:
>> on 06/05/2009 14:43 Helmut Schneider said the following:
>>> kbd1 at kbdmux0
>> [snip]
>>> atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0 atkbd0:
>>> <AT Keyboard> irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] 
>>> atkbd0: [ITHREAD]
>> [snip]
>>> ukbd0: <IBM IBM MM2, class 0/0, rev 1.10/0.01, addr 5> on uhub0 kbd0 at
>>> ukbd0
>> 
>> It took me three passes to notice the above: "kbd0 at atkbd0" and then again
>> "kbd0 at ukbd0".
> 
> Good point:
> 
> http://www.freebsd.org/cgi/query-pr.cgi?pr=122887 
> http://www.freebsd.org/cgi/query-pr.cgi?pr=133919
> 
> I have 'hint.atkbd.0.disabled="1"' at /boot/default.hints and (probably) 
> freebsd-update killed that one and silently replaced it with 1.16.8.1. The
> whole mess might be related. D'oh!

I don't actually understand fine details of what is happening when you don't have
atkbd disabled (or configured for acpi attachment as opposed to isa).
But I have a guess about why the system ultimately panics:
- atkbd_timeout function: first called from atkbd_attach_unit and then reschedules
itself at hz/10
- it accesses kbdsw[kbd->kb_index] without any checks, but there are
couple of places where kbd_unregister could be called
- thus kbdsw[kbd->kb_index] could become null or different keyboard
- and there is no untimeout ever


-- 
Andriy Gapon


More information about the freebsd-stable mailing list