Suspend hangs when connected to a specific usb keyboard

Mod edited: Reformating


Hello.
I’m having some trouble suspending my laptop after upgrading the peripherals with this new keyboard from Thermaltake: https://www.thermaltake.com/level-20-gt-rgb-razer-gaming-keyboard.html.
When the keyboard is connected, the screen goes blank, which is usual.
But then it comes back on and lastly goes black with no easy for me way to continue diagnosing.
Also, the second mechanical drive that I have in, clearly spins up one more time.
Thus, I went on restarting it holding its power button.
Without the keyboard, it all works as normal.
I tried a couple of things, including disabling autosuspend(which is still like that), changing the mem_sleep, hooking it to I think usb2(vs usb3) hub on my old monitor, but to no avail.
I just tried hibernate and it kind of works, but takes a lot more time, and I think it’s quite more stressful on the drives.
I just figured out, that unfortunately, it needs holding the power button to get manually cut off.

As a start, here is an output of inxi -Fzx :

System:
  Kernel: 5.9.11-3-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.0 
  Desktop: KDE Plasma 5.20.4 Distro: Manjaro Linux 
Machine:
  Type: Laptop System: HP product: HP ProBook 455 G6 v: N/A serial: <filter> 
  Mobo: HP model: 85D9 v: KBC Version 63.17.00 serial: <filter> UEFI: HP 
  v: R80 Ver. 01.12.00 date: 07/29/2020 
Battery:
  ID-1: BAT0 charge: 35.1 Wh condition: 36.2/36.2 Wh (100%) 
  model: Hewlett-Packard Primary status: Unknown 
CPU:
  Info: Quad Core model: AMD Ryzen 7 PRO 2700U w/ Radeon Vega Mobile Gfx 
  bits: 64 type: MT MCP arch: Zen L2 cache: 2048 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm 
  bogomips: 35145 
  Speed: 2872 MHz min/max: 1600/2200 MHz boost: enabled Core speeds (MHz): 
  1: 2872 2: 2714 3: 2090 4: 1780 5: 1366 6: 1371 7: 1370 8: 1380 
Graphics:
  Device-1: AMD Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] 
  vendor: Hewlett-Packard driver: amdgpu v: kernel bus ID: 05:00.0 
  Device-2: Lite-On HP HD Camera type: USB driver: uvcvideo bus ID: 3-2:3 
  Display: x11 server: X.Org 1.20.10 driver: amdgpu resolution: 
  1: 1920x1080~60Hz 2: 1920x1200~60Hz 
  OpenGL: renderer: AMD Radeon Vega 10 Graphics (RAVEN DRM 3.39.0 
  5.9.11-3-MANJARO LLVM 11.0.0) 
  v: 4.6 Mesa 20.2.3 direct render: Yes 
Audio:
  Device-1: AMD Raven/Raven2/Fenghuang HDMI/DP Audio vendor: Hewlett-Packard 
  driver: snd_hda_intel v: kernel bus ID: 05:00.1 
  Device-2: AMD Family 17h HD Audio vendor: Hewlett-Packard 
  driver: snd_hda_intel v: kernel bus ID: 05:00.6 
  Device-3: C-Media Audio Adapter (Unitek Y-247A) type: USB 
  driver: hid-generic,snd-usb-audio,usbhid bus ID: 1-4.3:4 
  Sound Server: ALSA v: k5.9.11-3-MANJARO 
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: Hewlett-Packard driver: r8169 v: kernel port: 4000 bus ID: 01:00.0 
  IF: enp1s0 state: down mac: <filter> 
  Device-2: Realtek RTL8822BE 802.11a/b/g/n/ac WiFi adapter 
  vendor: Hewlett-Packard driver: rtw_8822be v: N/A port: 3000 
  bus ID: 02:00.0 
  IF: wlp2s0 state: up mac: <filter> 
  IF-ID-1: br-42937f32bd60 state: down mac: <filter> 
  IF-ID-2: br-ba49b856f9e1 state: down mac: <filter> 
  IF-ID-3: br-c19da8d2299b state: down mac: <filter> 
  IF-ID-4: docker0 state: down mac: <filter> 
  IF-ID-5: virbr1 state: down mac: <filter> 
  IF-ID-6: virbr1-nic state: down mac: <filter> 
Drives:
  Local Storage: total: 704.24 GiB used: 394.06 GiB (56.0%) 
  ID-1: /dev/nvme0n1 vendor: SK Hynix model: BC501 HFM256GDJTNG-8310A 
  size: 238.47 GiB 
  ID-2: /dev/sda vendor: HGST (Hitachi) model: HTS725050B7E630 
  size: 465.76 GiB 
Partition:
  ID-1: / size: 216.50 GiB used: 83.53 GiB (38.6%) fs: ext4 
  dev: /dev/nvme0n1p2 
Swap:
  ID-1: swap-1 type: partition size: 17.00 GiB used: 0 KiB (0.0%) 
  dev: /dev/nvme0n1p3 
Sensors:
  System Temperatures: cpu: 66.4 C mobo: 0.0 C gpu: amdgpu temp: 66.0 C 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 290 Uptime: 1m Memory: 14.65 GiB used: 2.09 GiB (14.3%) 
  Init: systemd Compilers: gcc: 10.2.0 clang: 11.0.0 Packages: 1492 
  Shell: Bash v: 5.0.18 inxi: 3.1.08 

Also, the bios is quite new, being one version behind latest, and having read the release notes of the latest one, there seem to have nothing special that’d help.
I may try flashing it some time soon though.


Edit:

I also tried a couple of older kernels(5.4.80-2 being the oldest), which are available from manjaro kernels, but that didn’t have any effect.


Edit2:

This is mostly copy/paste from a post on arch forum, where they seem to not answer to questions from non-pure arch users.


Edit3:

I have an uncustomized(in regards to KDE, which I am using) guest user, which I just tried.
Upon login I get a notification desktop effects have been suspended by another application.
The good news is that the suspend works flawlessly there.
I may try resetting all my widgets, login manager, etc…
Anyway, I’m curious to know why the suspend hangs that badly?

Hi and welcome to the forum :+1:

Seeing that keyboard is a Razer, did you try using their own drivers or the ones at https://openrazer.github.io/ ?

Without logs it would be hard to tell…
You can look at your logs using journalctl -f in a terminal.

The keyboard is not razer, although it may have similar controller. Anyaways, I doubt openrazer supports my keyboard at the moment.
How can I fetch the logs while the system is hang?! I cannot even access some of the other ttys(e.g. ctrl+alt+f2-f4)?
Edit: the guest account suspension success seem to have been accidental yesterday. Today, all of the attempts lead to the same result - system hang, powered on led on the power button and fans spinning.

The link you mentioned clearly shows it is a Razer…

That could be a side effect of your keyboard not responding, it does not mean your whole system is “stuck”.
Try to connect another keyboard, run that command and plug this new one in,
Note: To see the logs related to this, you should execute that command before connecting this new Keyboard to your system.
(When you feel like your system hangs, you can unplug it again.)

No, it’s definitely not a razer keyboard. It’s the sub-model that comes with the razer green switches. The other two variants are with cherry mx switches. Although I find some similarities in the layout and putting it together with an older razer board, but that cannot be considered conclusive for its controller model/capabilities.

And I already have a build-in keyboard within the laptop. And it’s unresponsive in any way - I guess I could use sysrq to restart/shut down, but still there is no way I can see the logs… Or you are suggesting showing the logs while the keyboard is getting plugged in?! If that could help, ok, but as a developer myself, I expect to catch the reason right before it gets hang?! I remember something like windows dump file, and I am about to learn about its counterpart in linux, but I honestly haven’t got the need to go so far in diagnosing a low level hardware/os problem…
And to clear it all out, when the system hangs, unplugging doesn’t help - it’s just hung and I cannot do anything with it(apart from hold-power-button-reset or sysrq I guess).

Edit: here’s the journal when attaching the keyboard:

дек 24 19:06:51 hp-nb kernel: usb 1-3: New USB device found, idVendor=264a, idProduct=3027, bcdDevice= 9.09
дек 24 19:06:51 hp-nb kernel: usb 1-3: New USB device strings: Mfr=3, Product=1, SerialNumber=0
дек 24 19:06:51 hp-nb kernel: usb 1-3: Product: TT Premium Level 20 GT RGB
дек 24 19:06:51 hp-nb kernel: usb 1-3: Manufacturer: Thermaltake Inc.
дек 24 19:06:51 hp-nb kernel: input: Thermaltake Inc. TT Premium Level 20 GT RGB as /devices/pci0000:00/0000:00:08.1/0000:05:00.3/usb1/1-3/1-3:1.0/0003:264A:3027.001C/input/input71
дек 24 19:06:51 hp-nb kernel: hid-generic 0003:264A:3027.001C: input,hidraw5: USB HID v1.11 Keyboard [Thermaltake Inc. TT Premium Level 20 GT RGB] on usb-0000:05:00.3-3/input0
дек 24 19:06:54 hp-nb kernel: usbhid 1-3:1.1: can't add hid device: -71
дек 24 19:06:54 hp-nb kernel: usbhid: probe of 1-3:1.1 failed with error -71
дек 24 19:06:54 hp-nb kernel: usbhid 1-3:1.2: can't add hid device: -71
дек 24 19:06:54 hp-nb kernel: usbhid: probe of 1-3:1.2 failed with error -71
дек 24 19:06:54 hp-nb kernel: usb 1-3: USB disconnect, device number 16
дек 24 19:06:54 hp-nb kernel: usb 1-3: new full-speed USB device number 17 using xhci_hcd
дек 24 19:06:54 hp-nb kernel: usb 1-3: New USB device found, idVendor=264a, idProduct=3027, bcdDevice= 9.09
дек 24 19:06:54 hp-nb kernel: usb 1-3: New USB device strings: Mfr=3, Product=1, SerialNumber=0
дек 24 19:06:54 hp-nb kernel: usb 1-3: Product: TT Premium Level 20 GT RGB
дек 24 19:06:54 hp-nb kernel: usb 1-3: Manufacturer: Thermaltake Inc.
дек 24 19:06:54 hp-nb kernel: input: Thermaltake Inc. TT Premium Level 20 GT RGB as /devices/pci0000:00/0000:00:08.1/0000:05:00.3/usb1/1-3/1-3:1.0/0003:264A:3027.001D/input/input72
дек 24 19:06:54 hp-nb kernel: hid-generic 0003:264A:3027.001D: input,hidraw5: USB HID v1.11 Keyboard [Thermaltake Inc. TT Premium Level 20 GT RGB] on usb-0000:05:00.3-3/input0
дек 24 19:06:54 hp-nb kernel: hid-generic 0003:264A:3027.001E: hiddev2,hidraw6: USB HID v1.11 Device [Thermaltake Inc. TT Premium Level 20 GT RGB] on usb-0000:05:00.3-3/input1
дек 24 19:06:54 hp-nb kernel: input: Thermaltake Inc. TT Premium Level 20 GT RGB System Control as /devices/pci0000:00/0000:00:08.1/0000:05:00.3/usb1/1-3/1-3:1.2/0003:264A:3027.001F/input/input73
дек 24 19:06:54 hp-nb kernel: input: Thermaltake Inc. TT Premium Level 20 GT RGB Consumer Control as /devices/pci0000:00/0000:00:08.1/0000:05:00.3/usb1/1-3/1-3:1.2/0003:264A:3027.001F/input/input74
дек 24 19:06:54 hp-nb kernel: input: Thermaltake Inc. TT Premium Level 20 GT RGB Mouse as /devices/pci0000:00/0000:00:08.1/0000:05:00.3/usb1/1-3/1-3:1.2/0003:264A:3027.001F/input/input75
дек 24 19:06:54 hp-nb kernel: input: Thermaltake Inc. TT Premium Level 20 GT RGB Keyboard as /devices/pci0000:00/0000:00:08.1/0000:05:00.3/usb1/1-3/1-3:1.2/0003:264A:3027.001F/input/input76
дек 24 19:06:54 hp-nb kernel: hid-generic 0003:264A:3027.001F: input,hidraw7: USB HID v1.11 Mouse [Thermaltake Inc. TT Premium Level 20 GT RGB] on usb-0000:05:00.3-3/input2
дек 24 19:06:54 hp-nb mtp-probe[4098]: checking bus 1, device 17: "/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.3/usb1/1-3"
дек 24 19:06:54 hp-nb mtp-probe[4098]: bus: 1, device: 17 was not an MTP device
дек 24 19:06:54 hp-nb upowerd[777]: treating change event as add on /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.3/usb1/1-3
дек 24 19:06:54 hp-nb mtp-probe[4109]: checking bus 1, device 17: "/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.3/usb1/1-3"
дек 24 19:06:54 hp-nb mtp-probe[4109]: bus: 1, device: 17 was not an MTP device
дек 24 19:06:54 hp-nb mtp-probe[4112]: checking bus 1, device 17: "/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.3/usb1/1-3"
дек 24 19:06:54 hp-nb mtp-probe[4112]: bus: 1, device: 17 was not an MTP device
дек 24 19:06:54 hp-nb upowerd[777]: treating change event as add on /sys/devices/pci0000:00/0000:00:08.1/0000:05:00.3/usb1/1-3
дек 24 19:06:54 hp-nb systemd-logind[500]: Watching system buttons on /dev/input/event28 (Thermaltake Inc. TT Premium Level 20 GT RGB Keyboard)
дек 24 19:06:54 hp-nb systemd-logind[500]: Watching system buttons on /dev/input/event24 (Thermaltake Inc. TT Premium Level 20 GT RGB)
дек 24 19:06:54 hp-nb systemd-logind[500]: Watching system buttons on /dev/input/event25 (Thermaltake Inc. TT Premium Level 20 GT RGB System Control)
дек 24 19:06:54 hp-nb mtp-probe[4133]: checking bus 1, device 17: "/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.3/usb1/1-3"
дек 24 19:06:54 hp-nb mtp-probe[4133]: bus: 1, device: 17 was not an MTP device

As you can see, there are two errors, but I can only guess what’s the cause for them…

That command is actually showing the logs in real time as they happen, the -f flag means follow eg. keep updating the output.
That’s why i asked for the output of that command to see all logs that get generated when you plug-in the device (up-to the point you get hang) :wink:

Lets see what people with knowledge about usbhid have to say about the logs you provided.
It’s clear that there is some problem with initializing a driver there…

To access older logs (eg. from your previous boot after a hang you can use different flags, -b IIRC (see the manpage of that command)

10x, I’ll find out more about the prev- hang boot logs and hope to dig out any other suspicious stuff. I am glad, that we finally head for the same direction - i.e. this must be some kind of driver issue.
Edit: here are the logs from a previous session that had hang:

дек 24 20:08:34 hp-nb kernel: PM: suspend entry (deep)
дек 24 20:08:38 hp-nb kernel: Filesystems sync: 0.017 seconds
дек 24 20:08:38 hp-nb kernel: Freezing user space processes ... (elapsed 0.026 seconds) done.
дек 24 20:08:38 hp-nb kernel: OOM killer disabled.
дек 24 20:08:38 hp-nb kernel: Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
дек 24 20:08:38 hp-nb kernel: printk: Suspending console(s) (use no_console_suspend to debug)
дек 24 20:08:38 hp-nb kernel: rtw_8822be 0000:02:00.0: stop vif 10:5b:ad:2a:39:35 on port 0
дек 24 20:08:38 hp-nb kernel: sd 0:0:0:0: [sda] Synchronizing SCSI cache
дек 24 20:08:38 hp-nb kernel: sd 0:0:0:0: [sda] Stopping disk
дек 24 20:08:38 hp-nb kernel: [drm] free PSP TMR buffer
дек 24 20:08:38 hp-nb kernel: ACPI: EC: interrupt blocked
дек 24 20:08:38 hp-nb kernel: ACPI: Preparing to enter system sleep state S3
дек 24 20:08:38 hp-nb kernel: ACPI: EC: event blocked
дек 24 20:08:38 hp-nb kernel: ACPI: EC: EC stopped
дек 24 20:08:38 hp-nb kernel: PM: Saving platform NVS memory
дек 24 20:08:38 hp-nb kernel: Disabling non-boot CPUs ...
дек 24 20:08:38 hp-nb kernel: Wakeup pending. Abort CPU freeze
дек 24 20:08:38 hp-nb kernel: Non-boot CPUs are not disabled
дек 24 20:08:38 hp-nb kernel: ACPI: EC: EC started
дек 24 20:08:38 hp-nb kernel: ACPI: Waking up from system sleep state S3
дек 24 20:08:38 hp-nb kernel: ACPI: EC: interrupt unblocked
дек 24 20:08:38 hp-nb kernel: snd_hda_intel 0000:05:00.6: refused to change power state from D3hot to D0
дек 24 20:08:38 hp-nb kernel: ACPI: EC: event unblocked
дек 24 20:08:38 hp-nb kernel: sd 0:0:0:0: [sda] Starting disk
дек 24 20:08:38 hp-nb kernel: [drm] PCIE GART of 1024M enabled (table at 0x000000F400900000).
дек 24 20:08:38 hp-nb kernel: [drm] PSP is resuming...
дек 24 20:08:38 hp-nb kernel: nvme nvme0: 16/0/0 default/read/poll queues
дек 24 20:08:38 hp-nb kernel: [drm] reserve 0x400000 from 0xf43fc00000 for PSP TMR
дек 24 20:08:38 hp-nb kernel: snd_hda_intel 0000:05:00.6: CORB reset timeout#2, CORBRP = 65535
дек 24 20:08:38 hp-nb kernel: usb 3-1.1: reset full-speed USB device number 4 using xhci_hcd
дек 24 20:08:38 hp-nb kernel: amdgpu 0000:05:00.0: amdgpu: RAS: optional ras ta ucode is not available
дек 24 20:08:38 hp-nb kernel: ata2: SATA link down (SStatus 0 SControl 300)
дек 24 20:08:38 hp-nb kernel: ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
дек 24 20:08:38 hp-nb kernel: ata1.00: ACPI cmd f5/00:00:00:00:00:e0 (SECURITY FREEZE LOCK) filtered out
дек 24 20:08:38 hp-nb kernel: ata1.00: ACPI cmd b1/c1:00:00:00:00:e0 (DEVICE CONFIGURATION OVERLAY) filtered out
дек 24 20:08:38 hp-nb kernel: ata1.00: ACPI cmd f5/00:00:00:00:00:e0 (SECURITY FREEZE LOCK) filtered out
дек 24 20:08:38 hp-nb kernel: ata1.00: ACPI cmd b1/c1:00:00:00:00:e0 (DEVICE CONFIGURATION OVERLAY) filtered out
дек 24 20:08:38 hp-nb kernel: ata1.00: configured for UDMA/133
дек 24 20:08:38 hp-nb kernel: rtw_8822be 0000:02:00.0: start vif 10:5b:ad:2a:39:35 on port 0
дек 24 20:08:38 hp-nb kernel: [drm] kiq ring mec 2 pipe 1 q 0
дек 24 20:08:38 hp-nb kernel: amdgpu: dpm has been enabled
дек 24 20:08:38 hp-nb kernel: snd_hda_codec_realtek hdaudioC1D0: Unable to sync register 0x2b8000. -5
дек 24 20:08:38 hp-nb kernel: snd_hda_codec_realtek hdaudioC1D0: Unable to sync register 0x2b8000. -5
дек 24 20:08:38 hp-nb kernel: [drm] VCN decode and encode initialized successfully(under SPG Mode).
дек 24 20:08:38 hp-nb kernel: amdgpu 0000:05:00.0: amdgpu: ring gfx uses VM inv eng 0 on hub 0
дек 24 20:08:38 hp-nb kernel: amdgpu 0000:05:00.0: amdgpu: ring comp_1.0.0 uses VM inv eng 1 on hub 0
дек 24 20:08:38 hp-nb kernel: amdgpu 0000:05:00.0: amdgpu: ring comp_1.1.0 uses VM inv eng 4 on hub 0
дек 24 20:08:38 hp-nb kernel: amdgpu 0000:05:00.0: amdgpu: ring comp_1.2.0 uses VM inv eng 5 on hub 0
дек 24 20:08:38 hp-nb kernel: amdgpu 0000:05:00.0: amdgpu: ring comp_1.3.0 uses VM inv eng 6 on hub 0
дек 24 20:08:38 hp-nb kernel: amdgpu 0000:05:00.0: amdgpu: ring comp_1.0.1 uses VM inv eng 7 on hub 0
дек 24 20:08:38 hp-nb kernel: amdgpu 0000:05:00.0: amdgpu: ring comp_1.1.1 uses VM inv eng 8 on hub 0
дек 24 20:08:38 hp-nb kernel: amdgpu 0000:05:00.0: amdgpu: ring comp_1.2.1 uses VM inv eng 9 on hub 0
дек 24 20:08:38 hp-nb kernel: amdgpu 0000:05:00.0: amdgpu: ring comp_1.3.1 uses VM inv eng 10 on hub 0
дек 24 20:08:38 hp-nb kernel: amdgpu 0000:05:00.0: amdgpu: ring kiq_2.1.0 uses VM inv eng 11 on hub 0
дек 24 20:08:38 hp-nb kernel: amdgpu 0000:05:00.0: amdgpu: ring sdma0 uses VM inv eng 0 on hub 1
дек 24 20:08:38 hp-nb kernel: amdgpu 0000:05:00.0: amdgpu: ring vcn_dec uses VM inv eng 1 on hub 1
дек 24 20:08:38 hp-nb kernel: amdgpu 0000:05:00.0: amdgpu: ring vcn_enc0 uses VM inv eng 4 on hub 1
дек 24 20:08:38 hp-nb kernel: amdgpu 0000:05:00.0: amdgpu: ring vcn_enc1 uses VM inv eng 5 on hub 1
дек 24 20:08:38 hp-nb kernel: amdgpu 0000:05:00.0: amdgpu: ring jpeg_dec uses VM inv eng 6 on hub 1
дек 24 20:08:38 hp-nb pipewire[1403]: [E][000001532.414305][alsa-mixer.c:1366 element_set_switch()] Failed to set switch of 'Speaker': Input/output error

I hope anyone is able to grasp what’s happening…

FIY, executing

sleep 1 && systemctl suspend

from a thread titled Unable to suspend to ram from the arch forum(https://bbs.archlinux.org/viewtopic.php?id=252439) does the trick. It seems something keeps the kernel busy with input, which leads to hanging. I may try adding custom sleep command with that console code.
Addendum:
That was quite a fast fix. I just updated today those packages:

appstream-glib 0.7.18-2
pamac-cli
pamac-common
pamac-gtk

And the issue seems to be gone. If by any chance this can be read: huge thanks to the person that handled that!
Cheers,
Kostadin

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.