You are not logged in.

#1 2021-10-31 15:03:40

Soyman
Member
Registered: 2017-06-23
Posts: 27

[SOLVED] Input issues on resume after hibernation

I use my desktop computer all day every day and put it into hibernation every night so I don't have to set up my i3 workspaces and open all my programs every day.
some months ago I first encountered a bug where no HID device did anything. Plugging in a new keyboard/mouse did nothing either.
I don't think that the system was frozen. I tried hibernating with btop in the foreground and it showed firefox saturating one core upon resume.
I always have 10-20 firefox windows open and each can have 1-20 tabs. This issue only happened after around ~30% of resumes from hibernation.

Recently, after an update IIRC, the issue went away completely. However firefox had some rendering issues after resume. This was a known bug of firefox.

A few days ago, I ran another update and the rendering issues were resolved but now the input issues have occurred on every resume.
I tried hibernating with firefox closed and an instance of chromium and nyxt running.
The same issue occurred and chromium saturated 2 cores for about 30 seconds before settling down.
The input was unresponsive until I rebooted the computer.

I have found people with similar issues on the internet but most of them are laptop users.
Some have resolved their issues by adding

atkbd.reset

to

GRUB_CMDLINE_LINUX_DEFAULT

but that doesn't seem to resolve my issue.
I am suspending to a swapfile using

resume_offset

.

I've been using arch on/off for around 5 years and as a daily driver on desktop and laptop for half a year so I know my way around.
I'm however not sure how to debug this.
Any help is greatly appreciated.

Last edited by Soyman (2023-02-16 23:48:35)

Offline

#2 2021-11-01 15:58:30

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,101

Re: [SOLVED] Input issues on resume after hibernation

All HID usb wired?
Post the complete system journal of a boot/hibernate/resume cycle - a hard reboot w/ the powerbutton will most likely spoil the disk sync of the journal, so schedule a reboot in eg. the systemd sleep hook to run like 5 minutes after resuming from the hibernation (otherwise a clean reboot w/o any input is gonna be hard…)

Edit: bonus points if you try to re/attach (usb input) devices between resume and reboot.

Last edited by seth (2021-11-01 16:02:00)

Offline

#3 2021-11-21 13:16:41

Soyman
Member
Registered: 2017-06-23
Posts: 27

Re: [SOLVED] Input issues on resume after hibernation

I resolved my issue, thanks for pushing me on the right track.
I had tried reconnecting many usb devices after resuming from hibernation but it didn't work.

journalctl didn't seem to have any information. I don't think I could even see that point where the computer hibernated there.
I'm using https://xon.sh/
dmesg was a better candidate so I used sched to pipe dmesg to a file after hibernating and resuming since I couldn't use the keyboard to do it.

"dmesg --time-format iso" showed this upon hibernating

...
2021-11-21T00:54:29,524827+00:00 usb usb3: root hub lost power or was reset
2021-11-21T00:54:29,524832+00:00 usb usb2: root hub lost power or was reset
2021-11-21T00:54:29,524834+00:00 usb usb4: root hub lost power or was reset
2021-11-21T00:54:29,524847+00:00 usb usb1: root hub lost power or was reset
...

and this when resuming

...
2021-11-21T00:54:39,983553+00:00 xhci_hcd 0000:00:14.0: Abort failed to stop command ring: -110
2021-11-21T00:54:39,983561+00:00 xhci_hcd 0000:00:14.0: xHCI host controller not responding, assume dead
2021-11-21T00:54:39,983569+00:00 xhci_hcd 0000:00:14.0: HC died; cleaning up
2021-11-21T00:54:39,983599+00:00 xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
2021-11-21T00:54:40,396879+00:00 usb 4-5: device not accepting address 2, error -22
2021-11-21T00:54:40,398154+00:00 PM: hibernation: Basic memory bitmaps freed
2021-11-21T00:54:40,398159+00:00 OOM killer enabled.
2021-11-21T00:54:40,398159+00:00 Restarting tasks ... 
2021-11-21T00:54:40,398208+00:00 usb 4-5: USB disconnect, device number 2
2021-11-21T00:54:40,398261+00:00 usb 3-4: USB disconnect, device number 2
2021-11-21T00:54:40,399502+00:00 done.
2021-11-21T00:54:40,399916+00:00 PM: hibernation: hibernation exit
2021-11-21T00:54:40,409487+00:00 usb 4-6: USB disconnect, device number 3
2021-11-21T00:54:40,409492+00:00 usb 4-6.4: USB disconnect, device number 4
2021-11-21T00:54:40,415031+00:00 audit: type=1130 audit(1637456080.290:153): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hibernate comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
2021-11-21T00:54:40,415036+00:00 audit: type=1131 audit(1637456080.290:154): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hibernate comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
2021-11-21T00:54:40,570327+00:00 usb 3-9: USB disconnect, device number 3
2021-11-21T00:54:40,570331+00:00 usb 3-9.2: USB disconnect, device number 5
2021-11-21T00:54:40,570633+00:00 usb 3-10: USB disconnect, device number 4
2021-11-21T00:54:40,570635+00:00 usb 3-10.1: USB disconnect, device number 7
2021-11-21T00:54:41,127318+00:00 usb 3-10.3: USB disconnect, device number 8
2021-11-21T00:54:41,127325+00:00 usb 3-10.3.1: USB disconnect, device number 10
2021-11-21T00:54:41,127917+00:00 usb 3-10.4: USB disconnect, device number 9
2021-11-21T00:54:41,128363+00:00 usb 3-14: USB disconnect, device number 6
...

This problem is discussed in another thread and this solution worked for me.

I also used sched to try this command after hibernation and it worked! Great relief.
So I made a root-resume hook as described in the wiki which runs this script:

$cat reset_usb.sh

#!/bin/sh

echo "0000:00:14.0" > /sys/bus/pci/drivers/xhci_hcd/unbind
sleep 3
echo "0000:00:14.0" > /sys/bus/pci/drivers/xhci_hcd/bind

I don't know how stable these ids are but it hasn't failed yet.

Offline

#4 2021-11-21 13:57:52

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Input issues on resume after hibernation

Soyman wrote:

I use my desktop computer all day every day and put it into hibernation every night so I don't have to set up my i3 workspaces and open all my programs every day

I know this is irrelevant to the thread but you do know that you can configure i3 to automatically setup your workspaces and open your applications?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2021-11-21 15:10:47

Soyman
Member
Registered: 2017-06-23
Posts: 27

Re: [SOLVED] Input issues on resume after hibernation

Slithery wrote:
Soyman wrote:

I use my desktop computer all day every day and put it into hibernation every night so I don't have to set up my i3 workspaces and open all my programs every day

I know this is irrelevant to the thread but you do know that you can configure i3 to automatically setup your workspaces and open your applications?

I have tried two or three times to set it up to do so and I haven't managed to make it do what I want.
Hibernation does everything I want besides letting me upgrade but I'm fine with doing that just once in a while.
If you know how to make i3-resurrect or something else work as well as hibernation then please tell me how.
I want to restore all my firefox windows with all their tabs, all my emacs windows, all the various jetbrains IDEs and their windows. When I tried this last I mostly remember a bunch of placeholders that weren't correctly populated.

Offline

#6 2023-02-16 23:49:27

Soyman
Member
Registered: 2017-06-23
Posts: 27

Re: [SOLVED] Input issues on resume after hibernation

The issue went away eventually. I had some issues with black screens on resume from suspending but they too were eventually fixed through a nvidia driver update. It was on a 1080 GPU. Marking it as solved.

Offline

Board footer

Powered by FluxBB