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 .
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 . 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  but it turned out that this locking approach could not be used .
Created attachment 217837 [details]
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.