There is a timer in atkbd that is called 10 times per second. It seems to be a kludge that is used to unwedge keyboard interrupts [1]. Unfortunately, if I keep this in, my system locks up after a brief period of usage. I don't really know how to debug this -- the system just hangs. One important bit of information: I don't use the atkbd device in its default configuration behind the kbdmux0 device. Instead, I detach it from kbdmux0, open it directly and parse the keyboard data in userspace [2]. I feed the data into an Evdev device and a vkbd(4) device for use in vt(4). In the default configuration (atkbd0 attached to kbdmux0) the issue is masked. I haven't noticed any negative effects by disabling the atkbd_timeout timer. I'm using a Lenovo Thinkpad T420. I suspect it has to do with locking issues. There have been some attempts to improve locking in atkbd and psm [3] but it turned out that this locking approach could not be used [4]. [1]: https://svnweb.freebsd.org/base/head/sys/dev/atkbdc/atkbd.c?revision=326255&view=markup#l161 [2]: https://github.com/jiixyj/evdevfbsd/blob/e64ae7da580c9ccede482b380440d7b4636b4943/backend-atkbd.c#L108 [3]: https://lists.freebsd.org/pipermail/freebsd-arch/2017-May/018193.html [4]: https://reviews.freebsd.org/D10263#221930
Created attachment 217837 [details] disable atkbd_timeout I've attached the hack that I've been using for a few years now.
Hmm, I have tried the patch in question but it does not help in my case while I observe similar symptoms.
I am not sure how can it cause your symptoms, but I've just disabled the polling in head: https://cgit.freebsd.org/src/commit/?id=ce881170088c4c98c036fe561f8ee8413c2e2585
We can probably call it "fixed" for now.