I've got a weird annoyance on one of my #Linux laptops, and maybe someone knows something I don't... (details continue in self replies)
When I shut the lid, the laptop goes to sleep. Sometimes, when I open it, and it wakes up, the keyboard doesn't work at all. I can fix this by closing the lid, letting it sleep again, and then opening it. Usually that works on the first reopen, occasionally it takes 2 or 3, and on very rare occasion, I have to force restart or ssh in and reboot.
It didn't always do this. I'd say it's been about a year since this started. There seems to be no pattern. I can go a week with my usual habits of closing the lid and coming back without it happening, and another week it might be daily. The only noticable pattern is that closing the lid, unplugging the laptop lid closed, and later plugging it in having not opened it, and then leaving it for hours before finally opening the lid to resume has a much higher chance of unresponsive keyboard.

Model: Lenovo ThinkPad 11e (20D9-0020US).
Distro: Manjaro
Kernel: Linux 6.19.2-1-MANJARO (though several kernel updates have occured with no change)
DE: KDE Plasma
Currently still using X11, but this happens under Wayland as well. However, in Wayland, fixing it is flakier. Then again, this laptop is generally much flakier with Wayland, which is why I stuck to X11.

I can't remember if plugging in an external while the internal KB is unresponsive works, I don't often have one with me.

Touchpad and volume keys continue to work when the keyboard is unresponsive. I don't know if the hotkeys are getting through in that state as they normally don't do their associated functions while the lock screen is up.

It just occured to me I haven't thought to try disabling the lock screen to see if this still happens, but I'm in an environment where I really shouldn't leave a computer unlocked.

Oh, and dropping to tty doesn't work in that state either. However, ssh does, and I can clearly see all the other things the machine is doing continue normally. I just can't unlock it due to the keyboard not responding. I HAVE tried enabling OSK and can unlock by tediously entering the password with the trackpad, but they keyboard remains unresponsive after unlocking. I probably should leave the OSK available, in case it happens when I have stuff I need to save.
@hellomiakoda Makes me wonder if there is a power management setting in the bios which is also taking action and you essentially have a race condition with the Linux OS when the lid is opened. Have a look in bios for any ACPI power settings or legacy mode. Toggle the settings around. First thing that popped into my mind.
@JaxxAI I'll reboot and take a look. I'll report back in a couple minutes and let you know what I find.

@JaxxAI Well, found the following...
Wake on LAN: AC Only (changed to disabled)
Always on to USB: Enabled (changed)

Intel SpeedStep Technology: Enabled
Mode for AC: Max Performance
Mode for Battery: Battery Optimization
CPU Power Management: Enabled
(Changed all that to disabled)

I still have a slider for power profile. I'm curious if that still does anything with those BIOS features disabled.

@JaxxAI I'm going to guess turning those settings off did something. I unplugged and the estimate says 23:[something] and changed to 14:00 a moment later. Oh it's RAPIDLY falling, 10:56, 7:56, 6:15 now. But, the battery percentage isn't falling with it. I assume whatever data that battery time estimate uses is either cleared, or thoroughly confused by the new settings.
Not a big deal, I never really trust that estimate anyway. Just a notable difference.
@JaxxAI Normally, this laptop, in power save, has an estimate of like 6 to 9 hours. (Pretty damn good for a laptop of this age! ...and it does actually get 6 to 8 hours! Less if I'm streaming something the whole time).