Laptop keyboard ignores the very first keypress.

Hi guys!

I'm running FreeBSD 13.4-RELEASE on ThinkPad Edge 11 and I have sort of issue with the integrated keyboard.

After a boot process, when I want to log in (in the bare console) my keyboard ignores the first keypress I do (whatever key it is) - just doesn't react on it. But after that, keyboard works fine (handles the presses well). It's requires exactly one press for me to get it work - it's not the matter of time (I waited for about 10 minutes before starting to input, but the problem didn't disappear). It looks like that the keyboard it kind of "sleeping" and I need to hit a key in order to "wake it up".

It's important to say, that previously (right before FreeBSD) I used to run Debian 11 and I didn't have such an issue.

I found an old thread that describes the similar problem, but it has no actual answer for it. I checked out my BIOS settings, but I didn't see any setting/option that could be related to this problem (there are mainly layout/Fn keys settings). I also found a couple of more-or-less close problems in the Internet, but all of them has no working solution either.

Well, I thought that compiling the kernel myself can solve the problem. So I did, but nothing changed (so, the problem happens with GENERIC kernel as well). I'm quite new to the kernel tinkering, but I also tried to compile without keyboard multiplexer kbdmux(4), but it did affect nothing.

The fact that I was successfully running Debian without such an issue before, doesn't let me believe that it is a hardware problem.

Now I don't even know what to do and I want to ask you guys for help - maybe some of you encountered the same issue, or have some guesses/ideas on how to fix that/what may be the cause. I appreciate any help!

P.S. I also send my dmesg(/var/run/dmesg.boot) as an attachment.


Artem.
 

Attachments

You are loading a DRM driver for your video card. Can you test without the DRM driver being loaded?
Also, can you test with an external USB keyboard connected before you turn on your computer? Make the first keypress after FreeBSD boots on the external keyboard.
 
I can add that this is not specific to your hardware. I've been seeing this also on a frame.work Intel 12th gen. First key press after boot is ignored.
Runs on 14.2 and still applies, probably since around 13 (with my own kernel and patch set). Never got around to troubleshoot it in detail, unfortunately.
It happens on vt as well as on graphical console, so I assume it's not directly related to graphics - at least not alone.
 
You are loading a DRM driver for your video card. Can you test without the DRM driver being loaded?
Also, can you test with an external USB keyboard connected before you turn on your computer? Make the first keypress after FreeBSD boots on the external keyboard.
Hi, Jordan!

I unloaded the drm driver, but result is the same.

Also just tried to plug an external USB-keyboard and it works fine (first keypress does register). So, it seems like it's specific to laptop keyboard. But I just can't understand how was it working on another OS?
 
I can add that this is not specific to your hardware. I've been seeing this also on a frame.work Intel 12th gen. First key press after boot is ignored.
Runs on 14.2 and still applies, probably since around 13 (with my own kernel and patch set). Never got around to troubleshoot it in detail, unfortunately.
It happens on vt as well as on graphical console, so I assume it's not directly related to graphics - at least not alone.
cmoerz, thanks for your reply.

Did it happen on any other OS as well? Or it seems to be a FreeBSD-specific issue?
 
Have not tried it on any other - I expect it is FreeBSD specific.
I suspect it might be something with a specific keyboard controller and interaction with vt or evdev. Just a hunch though.
 
Artem, can you reproduce the problem when booting from installation medium? If so, it would be easy to test with FreeBSD 14.2 (the latest release) and with a snapshot of 15-CURRENT.

The problem may be related to interrupts and there was one fix last year that might be relevant (src commit 0a34d050ae8ea14feddd3d2a62fd2f612613b2c5). Try this: Execute sysctl hw.acpi.override_isa_irq_polarity to read the current value of the sysctl and then set it from the loader prompt to the opposite value (if it is 1, set it to 0; if it is 0, set it to 1). Always boot without the DRM video driver when testing.

Something else you can try is to boot in single-user mode, or in safe mode, or with ACPI disabled. These are all options in the loader's menu.
 
Artem, can you reproduce the problem when booting from installation medium? If so, it would be easy to test with FreeBSD 14.2 (the latest release) and with a snapshot of 15-CURRENT.

The problem may be related to interrupts and there was one fix last year that might be relevant (src commit 0a34d050ae8ea14feddd3d2a62fd2f612613b2c5). Try this: Execute sysctl hw.acpi.override_isa_irq_polarity to read the current value of the sysctl and then set it from the loader prompt to the opposite value (if it is 1, set it to 0; if it is 0, set it to 1). Always boot without the DRM video driver when testing.

Something else you can try is to boot in single-user mode, or in safe mode, or with ACPI disabled. These are all options in the loader's menu.
Thank you very much for the information, Jordan!

I tried that. I grabbed an ISO image of 14.2-RELEASE and booted from the USB stick.

I looked up for sysctl hw.acpi.override_isa_irq_polarity value and it's 1 on my machine.
At the boot menu I escaped to the boot loader and typed set hw.acpi.override_isa_irq_polarity=0, then boot, but I still got the problem. I also did a bit more investigation and found this discussion and this message. Here this tunable is referred to as hw.acpi.isa_irq_override_polarity
- so I tried to set this to 0 as well - didn't work either.

Regarding other boot options:
- With ACPI off, the system refuses to boot.
- Booting in single user mode/safe mode doesn't solve the problem with the keyboard.
 
Back
Top