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.

I'd say on average, it occurs like 15% of the time, though when it's being crankier, it can happen as often as 50% of the time.

Notably, I haven't yet had it happen away from home. I don't take it out much though, so that could just be coincidence. The only things different would be offline (though I rarely think to actually turn the wifi off), running on battery - which my settings change it to the power save power profile.

Oh, and in case it matters, this laptop is not currently using full disk encryption, but does have an encrypted partition.

The only mods done to this laptop was the RAM was doubled to 8GB, and the HDD was replaced with an SSD. Standard stuff. SSD is a super cheapy, but there are no signs of any issue with the SSD.
(GOD I love super cheap SSD when the data isn't critical!)

@hellomiakoda I am a rank noob, but I did just hear that Manjaro has been getting buggier as the years go by due to internal mismanagement. This *could* be a result of that.

Just a thought.

@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.

@hellomiakoda I’ve not encountered the same issues as you and I’ve had Linux on many machines. I don’t have a solution right now but I will ask colleagues in the morning. My advice is to test and keep retesting. I imagine it will be something ridiculous like one of those settings not getting on with Linux. Also, double check and ensure you have the recent firmware for that Thinkpad, they have been known to release a bad firmware occasionally.
@hellomiakoda forgot to mention, when you do encounter the issue, make a note of time and date. When you get back into laptop, have a look in syslog and kern log to see if you have a timeout occurring at that time in relation the keyboard driver.
@JaxxAI SSH usually works when the keyboard goes unresponsive. Anything I can do in the immediate while it's still stuck?

@hellomiakoda if you see a timeout in relation to the keyboard driver in syslog or kern logs, try reloading it, I’m curious to know if that brings it back. Something like:

sudo modprobe -r atkbd && sudo modprobe atkbd

Also, put the power settings back to what they were in bios if they didn’t fix it, especially speedstep or your battery will drain fast.

@JaxxAI I doubt there's an update. I know I checked that when I got it, 2nd hand. God, I do not remember how to update this thing's firmware. I really hope it's not some windows BS, but if it is, I have a drive I can chuck in for that. Oh, if it makes any difference, It's in legacy BIOS mode. I don't remember what the issue was exactly, but I remember there was a show stopping issue when I tried installing when I got it that made me switch from EUFI to BIOS.
@JaxxAI Same issue applies to MediCat. So if we need the details of what that EUFI issue was, I can dig out my MediCat and boot that EUFI.
I can't for the life of me remember what it was, just that it renders the laptop completely unusable.
@JaxxAI I tried a live boot Manjaro in EUFI mode after the update just to see if that's fixed... Booting Linux in EUFI just hangs. Yep, I remember now. That is with Secure Boot disabled.
Curiosity solved on that specific thing, lol. (I do not care, I don't see much detriment to using BIOS mode anyway)
@JaxxAI Well I'll be damned. There was indeed an update. Flashing it now. Conveniently, they offered a bootable ISO, not just the Windows utility.
@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).
@JaxxAI Just in case you or anyone else reading was curious....
I found the power draw in info center, and changed the power mode slider from one side to the other. It did change by about a watt and a half. I don't recall if the change was bigger with SpeedStep and all that enabled. I'll experiment with that, if I remember, after we figure out this issue. I'm super curious. I forgot I could see that in info center. Almost scared to find out what my big laptop is burning through.
@hellomiakoda
Some of that is hardware and some of that is the distro you're using, neither of which you have given us information about.
@bardmoss Yep, https://pdx.social/@hellomiakoda/116275393884377244
Totally didn't ANY information about ANYTHING! https://pdx.social/@hellomiakoda/116275393884377244
If only I had given SOME INFO https://pdx.social/@hellomiakoda/116275393884377244 about this computer and the software on it!
How could I forget something like https://pdx.social/@hellomiakoda/116275393884377244 that?!
Why couldn't I just give some info https://pdx.social/@hellomiakoda/116275393884377244 instead of nothing?!
Miakoda :neurodiversity: (@[email protected])

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.

pdx.social
@hellomiakoda
I can only read the messages to come across my screen. I saw no links to anything else. Then I did see your post with your hardware and responded to that.
@hellomiakoda
Manjaro is going through some hiccups right now, the community is complaining that the team is not paying them any attention. Arch in general is problematic. I would suggest trying something based on Debian or Ubuntu.
@bardmoss I left Ubuntu and Debian based distros because I got fed up with PPAs
@hellomiakoda
You traded PPAs for AUR? I don't understand that.
@bardmoss PPAs constantly failed, AUR rarely does
@hellomiakoda
The intermittent nature, and that it started after a while, makes me wonder if the lid switch is wearing out, and getting too bouncy -- making the system think that when you open the lid you are actually open/close/open/close/opening the lid (or the other direction, or both). This would dramatically increase the chances of a race of some kind.
@Retreival9096 I should be able to test that theory with a magnet, and just trigger it a bunch. If that's the case, it shouldn't be difficult to find a replacement
@hellomiakoda
Hope it works, or the fix is otherwise easy

@hellomiakoda I have a Thinkpad at work which does this... On windows 11. Rebooting it works. I don't have the exact model in mind but it was bought in like 2019.

It also wasn't doing that initially, for years.

@cmdrDiscoCat Curiously, when it does it again, try shutting the lid for a minute, then open again. I want to know if that fix works in Windows.
@hellomiakoda I'll try !

@hellomiakoda Well, you know what, I just tried.

Out of hibernation, no keyboard. Lid closed to put it in suspend. Waited a bit. Reopened it. Keyboard still not responding.

The only thing that works is to shut it down completely, and start it again.

I wonder if it happens from cold boot too. Maybe fast boot shenanigans ?