Keyboard stops working after suspension

Hi,
I am running Fedora 40 with kernel 6.10.6-200.fc40.x86_64 on a Lenovo IdeaPad Slim 3 15ABR8 with a Ryzen 7 7730U.

At startup the laptop’s keyboard is fine, but if the computer goes into sleep mode, it stops working.
I’ve found that similar problems were fixed by modifying the grub configuration, for example by including:
GRUB_CMDLINE_LINUX=“i8042.dumbkbd=1”
GRUB_CMDLINE_LINUX_DEFAULT=“quiet i8042.debug=1 i8042.noaux=1 i8042.dumbkbd”

and then running grub2-mkconfig, but this didn’t work.

How can I fix this?

1 Like

Hi Davide. Welcome to :fedora: .

In the title you’re mentioning about suspension (suspend to ram is assumed), whereas in the message you are referring to hibernation (suspend to disk). Which sleeping state is it?

Is it only the keyboard which is not working? Mouse and display do work? Does the system wake up from sleep?

Is this issue related only to the latest kernel, or does it happen with older kernels too?

Hi! Thank you.

  1. I’m sorry for the inaccuracy, it is the laptop sleep mode, it is suspends to RAM (edited the post accordingly)
  2. Only the laptop integrated keyboard does not work. Mousepad and USB attached keyboards are fine. If use any working peripherals, the system succesfully wakes up.
  3. The issue happens with 6.10.6-200.fc40.x86_64 and 6.8.5-301.fc40.x86_64 wheter I modify the grub.cfg or not.

Does this also happen when no peripherals are attached? When it does happen, do you need to plug in an external keyboard in order to be able to log in?

Do you see anything in the logs? You could check that with journalctl -b after a system wakeup (and narrow down the output with -S and -U options, using the date/time right before the system is left idle and after it wakes up). You can also post the output here, as preformatted text (using the </> icon).

Please also post the output of inxi -Fzxx (as preformatted text too).

Yes. This happens also without any peripheral attached, and I have to use an USB keyboard to log in.

I get no entries in the logs around the time i suspend the laptop:

$sudo journalctl -b -S "2024-02-09 11:20:00" -U "2024-02-09 11:25:00"
-- No entries --

By filtering the logs for the name of the integrated keyboard i find:

set 02 13:03:38 fedora kernel: input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input2
set 02 11:03:44 fedora systemd-logind[1034]: Watching system buttons on /dev/input/event2 (AT Translated Set 2 keyboard)

Here are system information:

$inxi -Fzxx
System:
  Kernel: 6.10.6-200.fc40.x86_64 arch: x86_64 bits: 64 compiler: gcc
    v: 2.41-37.fc40
  Console: pty pts/1 wm: gnome-shell DM: GDM Distro: Fedora Linux 40
    (Workstation Edition)
Machine:
  Type: Laptop System: LENOVO product: 82XM v: IdeaPad Slim 3 15ABR8
    serial: <filter> Chassis: type: 10 v: IdeaPad Slim 3 15ABR8 serial: <filter>
  Mobo: LENOVO model: LNVNB161216 v: SDK0T76463WIN serial: <filter>
    part-nu: LENOVO_MT_82XM_BU_idea_FM_IdeaPad Slim 3 15ABR8 UEFI: LENOVO
    v: KYCN31WW date: 03/18/2024
Battery:
  ID-1: BAT0 charge: 14.2 Wh (30.2%) condition: 47.0/47.0 Wh (100.0%)
    volts: 10.8 min: 11.3 model: BYD L22B3PF2 serial: <filter>
    status: discharging
CPU:
  Info: 8-core model: AMD Ryzen 7 7730U with Radeon Graphics bits: 64
    type: MT MCP arch: Zen 3 rev: 0 cache: L1: 512 KiB L2: 4 MiB L3: 16 MiB
  Speed (MHz): avg: 477 high: 1638 min/max: 400/4546 cores: 1: 400 2: 400
    3: 1638 4: 400 5: 400 6: 400 7: 400 8: 400 9: 400 10: 400 11: 400 12: 400
    13: 400 14: 400 15: 400 16: 400 bogomips: 63881
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: AMD Barcelo vendor: Lenovo driver: amdgpu v: kernel arch: GCN-5
    pcie: speed: 8 GT/s lanes: 16 ports: active: eDP-1 empty: DP-1,HDMI-A-1
    bus-ID: 04:00.0 chip-ID: 1002:15e7 temp: 35.0 C
  Device-2: Chicony Integrated Camera driver: uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 bus-ID: 1-3:2 chip-ID: 04f2:b7b9
  Display: server: X.Org v: 24.1.2 with: Xwayland v: 24.1.2
    compositor: gnome-shell driver: dri: radeonsi gpu: amdgpu display-ID: :0
    screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96
  Monitor-1: eDP-1 model: AU Optronics 0xe48d res: 1920x1080 dpi: 143
    diag: 395mm (15.5")
  API: OpenGL v: 4.6 vendor: amd mesa v: 24.1.6 glx-v: 1.4 es-v: 3.2
    direct-render: yes renderer: AMD Radeon Graphics (radeonsi renoir LLVM
    18.1.6 DRM 3.57 6.10.6-200.fc40.x86_64) device-ID: 1002:15e7
  API: EGL Message: EGL data requires eglinfo. Check --recommends.
Audio:
  Device-1: AMD Renoir Radeon High Definition Audio vendor: Lenovo
    driver: snd_hda_intel v: kernel pcie: speed: 8 GT/s lanes: 16
    bus-ID: 04:00.1 chip-ID: 1002:1637
  Device-2: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: Lenovo driver: N/A
    pcie: speed: 8 GT/s lanes: 16 bus-ID: 04:00.5 chip-ID: 1022:15e2
  Device-3: AMD Family 17h/19h HD Audio vendor: Lenovo driver: snd_hda_intel
    v: kernel pcie: speed: 8 GT/s lanes: 16 bus-ID: 04:00.6 chip-ID: 1022:15e3
  API: ALSA v: k6.10.6-200.fc40.x86_64 status: kernel-api
  Server-1: JACK v: 1.9.22 status: off
  Server-2: PipeWire v: 1.0.7 status: n/a (root, process) with:
    1: pipewire-pulse status: active 2: wireplumber status: active
    3: pipewire-alsa type: plugin
Network:
  Device-1: MEDIATEK MT7921 802.11ax PCI Express Wireless Network Adapter
    vendor: Lenovo driver: mt7921e v: kernel pcie: speed: 2.5 GT/s lanes: 1
    bus-ID: 02:00.0 chip-ID: 14c3:7961
  IF: wlp2s0 state: up mac: <filter>
Bluetooth:
  Device-1: Foxconn / Hon Hai MediaTek Bluetooth Adapter driver: btusb v: 0.8
    type: USB rev: 2.1 speed: 480 Mb/s lanes: 1 bus-ID: 3-4:4 chip-ID: 0489:e0cd
  Report: btmgmt ID: hci0 rfk-id: 0 state: down bt-service: enabled,running
    rfk-block: hardware: no software: yes address: <filter> bt-v: 5.2 lmp-v: 11
Drives:
  Local Storage: total: 953.87 GiB used: 17.56 GiB (1.8%)
  ID-1: /dev/nvme0n1 vendor: solidgm model: SSDPFINW010TZL size: 953.87 GiB
    speed: 63.2 Gb/s lanes: 4 serial: <filter> temp: 29.9 C
Partition:
  ID-1: / size: 371.53 GiB used: 17.19 GiB (4.6%) fs: btrfs
    dev: /dev/nvme0n1p6
  ID-2: /boot size: 973.4 MiB used: 329 MiB (33.8%) fs: ext4
    dev: /dev/nvme0n1p5
  ID-3: /boot/efi size: 256 MiB used: 48.9 MiB (19.1%) fs: vfat
    dev: /dev/nvme0n1p1
  ID-4: /home size: 371.53 GiB used: 17.19 GiB (4.6%) fs: btrfs
    dev: /dev/nvme0n1p6
Swap:
  ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) priority: 100
    dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 34.0 C mobo: N/A gpu: amdgpu temp: 35.0 C
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 16 GiB note: est. available: 13.48 GiB used: 1.64 GiB (12.2%)
  Processes: 368 Power: uptime: 8m wakeups: 1 Init: systemd v: 255
    target: graphical (5) default: graphical
  Packages: pm: flatpak pkgs: 8 Compilers: N/A Shell: Sudo v: 1.9.15p5
    running-in: gnome-terminal inxi: 3.3.34

With time interval the -b option needn’t be used. The date format is wrong (MM and DD are switched). The time interval should also be increased (since before the system is left unattended, until the system is waken up from sleep, which should certainly be more than 5 minutes).

There are several system crashes being reported in relation with kernel 6.10 and AMD Ryzen CPUs, see posts here and here. While your issue is different, it might be related. You could also check if the issue disappears by booting with kernel 6.9.

I installed kernel version 6.9.12-100.fc39.x86_64 but I keep encountering the same problem

I have tried many things…
The only one which led to something close to a solution has been downgrading to Fedora 39. On kernel 6.5.6-300.fc39.x86_64 it happened randomly, while on the kernel 6.10.8-100.fc39.x86_64 it kept happening. I will try other kernels but so far it seems the best solution, hoping that next updates will fix this…
@tqcharm

I have tried many different kernels. The latest where it seems not to give problems is 6.6.14-200.fc39.x86_64.
I might try other things but for now I will stick to an older kernel.
The problem presented also with Linux Mint 22 which is based on kernel 6.8, so I guess it is a laptop problem.

Might be the laptop issue as well. The system logs after suspend, as detailed in the above posts, could provide some hints.

Power management is often a problem – there have been efforts to promote standard interfaces, but battery life and overall power demands are key selling points. Vendors compete with proprietary “enhancements”. There are USB dongles with a button or two that can be programmed as a “keyboard” to enter a specific sequence. Example.

I have left this issue aside for some time, but today booting up 6.10.10-100.fc39.x86_64+debug, i managed to pinpoint an error which might be the problem:

14:43:56 kernel: hid-generic 0003:145F:02C9.0003: input,hidraw2: USB HID v1.10 Device [SIGMACHIP Trust Keyboard] on usb-0000:04:00.4-1/input1
14:43:56 kernel: input: SIGMACHIP Trust Keyboard System Control as /devices/pci0000:00/0000:00:08.1/0000:04:00.4/usb3/3-1/3-1:1.1/0003:145F:02C9.0003/input/input18
14:43:56 kernel: hid-generic 0003:145F:02C9.0002: input,hidraw1: USB HID v1.10 Keyboard [SIGMACHIP Trust Keyboard] on usb-0000:04:00.4-1/input0
14:43:56 kernel: input: SIGMACHIP Trust Keyboard as /devices/pci0000:00/0000:00:08.1/0000:04:00.4/usb3/3-1/3-1:1.0/0003:145F:02C9.0002/input/input16
14:43:56 kernel: usb 3-1: Product: Trust Keyboard
14:42:49 kernel: atkbd serio0: Failed to deactivate keyboard on isa0060/serio0
14:40:23 kernel: ideapad_acpi VPC2004:00: Keyboard backlight control not available
16:40:01 kernel: input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input2

The error which was raised as soon as I woke up the laptop is:

14:42:49 kernel: atkbd serio0: Failed to deactivate keyboard on isa0060/serio0

Maybe somebody can solve this??

@tqcharm

Well, from what I have seen online, it seems that your issue is somewhat common. I am not even sure why the i8042-related GRUB parameters would be working, as I understand that i8042 is the designation of a PS/2 controller. Nevertheless, it seems to have worked for others with similar laptops, so it is probably worth trying.

Am I correct in understanding that you are using X.org as display server? If yes, does your issue also happen under Wayland?

Regarding passing additional GRUB parameters, how did you do that?

  • For temporary purposes, easiest is to edit the GRUB entry before booting (by pressing the e key on the selected boot entry) and adding the flags, then booting. This change is not persistent, but valid only for the current boot.
  • If instead you edited the GRUB configuration file, are you sure you ran the grub2-mkconfig correctly? Usually it is less prone to errors to use grubby for such purposes:
    • verify that your GRUB entries were added correctly, by running sudo grubby --info=ALL
    • if needed, modify the kernel arguments with sudo grubby --update-kernel=ALL --args='i8042.debug=1 i8042.noaux=1 i8042.dumbkbd'[1].

  1. Those arguments are the ones posted in the OP, I have no means to verify if they do actually work. ↩︎

1 Like

Thank you for the insighful information, @tqcharm

Looks like I managed to fix it by passing these kernel arguments:

i8042.debug=1 i8042.nopnp=1

I’m going to test it further, but the keyboard worked after I left it for ~10 min and woke up

2 Likes

Many laptops use PS/2 keyboards. Here:

% jctlnh -b -g i8042                                           
Sep 23 04:51:16 kernel: i8042: PNP: PS/2 Controller [PNP0303:PS2K] at 0x60,0x64 irq 1
Sep 23 04:51:16 kernel: i8042: PNP: PS/2 appears to have AUX port disabled, if this is incorrect please boot with i8042.nopnp
Sep 23 04:51:16 kernel: i8042: Warning: Keylock active
Sep 23 04:51:16 kernel: serio: i8042 KBD port at 0x60,0x64 irq 1
Sep 23 04:51:16 kernel: input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input4
Sep 23 07:52:03 kernel: dell_laptop: Using i8042 filter function for receiving events

I’ve seen many suggestions of kernel options related to PS/2 keyboa rds, including atkbd.reset=1, i8042.nomux, i8042.reset, i8042.nopnp, i8042.direct, i8042.noloop, i8042.debug, i8042.noaux, i8042.dumbkbd', and i8042.notimeout but haven’t tracked down authoritative documentation other than the kernel sources. These appear to be workarounds for BIOS bugs:

PATCH v4 0/2 – i8042: Add force norestore quirk to leave controller.

1 Like

True. From Davide’s post I’ve just considered that in this case the builtin keyboard was a USB one, but now that I think about it, what those journalctl logs might be referring to is the external keyboard needed to enter password after system wake-up. Besides, the last line from the snippet does refer to i8042 too.

For future reference, this is an excerpt[1] from the kernel parameters documentation referring to i8042 driver:

	i8042.debug	[HW] Toggle i8042 debug mode
	i8042.unmask_kbd_data
			[HW] Enable printing of interrupt data from the KBD port
			     (disabled by default, and as a pre-condition
			     requires that i8042.debug=1 be enabled)
	i8042.direct	[HW] Put keyboard port into non-translated mode
	i8042.dumbkbd	[HW] Pretend that controller can only read data from
			     keyboard and cannot control its state
			     (Don't attempt to blink the leds)
	i8042.noaux	[HW] Don't check for auxiliary (== mouse) port
	i8042.nokbd	[HW] Don't check/create keyboard port
	i8042.noloop	[HW] Disable the AUX Loopback command while probing
			     for the AUX port
	i8042.nomux	[HW] Don't check presence of an active multiplexing
			     controller
	i8042.nopnp	[HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX
			     controllers
	i8042.notimeout	[HW] Ignore timeout condition signalled by controller
	i8042.reset	[HW] Reset the controller during init, cleanup and
			     suspend-to-ram transitions, only during s2r
			     transitions, or never reset
			Format: { 1 | Y | y | 0 | N | n }
			1, Y, y: always reset controller
			0, N, n: don't ever reset controller
			Default: only on s2r transitions on x86; most other
			architectures force reset to be always executed
	i8042.unlock	[HW] Unlock (ignore) the keylock
	i8042.kbdreset	[HW] Reset device connected to KBD port
	i8042.probe_defer
			[HW] Allow deferred probing upon i8042 probe errors

  1. I have used code block instead of blockquote in order to retain original text formatting. ↩︎

Dude, you have no idea how grateful I am to you for raising this issue, I have the same laptop as you, I bought it in early August 2024 and was also struggling with the keyboard, changed distributions, updated the kernel, but still could not fix this bug, now I switched to Fedora and encountered the same problem, edited the grub config as you said and everything works for me! Thank you very much again and also to all the guys who helped you solve this problem, have a great day!

I am very happy that this thread helped you. Have a good day, and happy computing.