Keyboard sometimes won't work after sleep

On two occasions I’ve woken up my Framework 16 laptop to find that the keyboard has stopped working, making the laptop unusable.

I’m running Ubuntu 24.04.

The trackpad kept working, and the power button worked enough for me to hold it down for 15 seconds to force-shutdown the computer, at which point pressing power again to start it up booted successfully.

I see these kernel errors from around when the problem occurred, using sudo journalctl -k -b -1 -o short-precise:

May 26 20:08:10.783554 sapling kernel: xhci_hcd 0000:c1:00.3: Timeout while waiting for setup device command
May 26 20:08:10.990561 sapling kernel: usb 2-2: device not accepting address 88, error -62
May 26 20:08:10.998633 sapling kernel: usb usb2-port2: unable to enumerate USB device
May 26 20:08:15.388496 sapling kernel: kauditd_printk_skb: 158 callbacks suppressed

I’d say check all the connections to the midplate.

Is this diagnosis based on anything? If the connection were bad, why would turning the machine off and on again fix it?

It is a good suggestion just to be sure. Movement of the laptop and the forces that go along with that, could affect the connector, etc. Checking that it is firmly attached is just a way to rule the connector out of the equation.

But pursuant to the errors you are showing, a device not plugged in, would exhibit the same output.

It doesn’t really seem like you’re reading my problem and responding to it. Of course my keyboard is plugged in. I am typing on it.

I don’t think I am going to learn anything by disassembling the machine to check whether my keyboard is plugged in, because it is obviously plugged in. There is no plausible mechanism where rebooting the machine would have plugged the keyboard back in. It was plugged in the whole time.

I believe I have encountered a software or firmware problem that makes the keyboard not work after sleep/suspend, and I am looking for a solution.

I also encountered this this morning.

I will check the logs later today to see what I can find.

I was away from my desk without an external keyboard so I had to hard reset the machine to get the keyboard to work again.

I think there might be a bug in the linux usb driver software. I don’t think this is a hardware/connector issue.
To help other people reproduce this please provide:

  1. which devices are in which expansion slots.
  2. whether the devices were there at boot time or added later.
  3. if removing any expansion cards helps. If so, say which card from which slot. It might take 30sec between removal of card to it helping.

Note: the keyboard of the FW16 is usb, this is why maybe removing expansion cards, that are also usb, might help.

As the keyboard is USB, it might help to remove it briefly while the machine is running. From what I’ve read, the machine will disable power to the midplate once the trackpad is removed, so that should be enough to re-initialize the input modules.

The power to keyboard and track pad is also removed if you remove a keyboard spacer. It’s easy to tell because the backlights of the keyboard go out when the spacer is removed.
Note: there is a bios setting to disable power off, but for this, we would want it enabled. Enabled is the default.