You are not logged in.

#1 2023-11-26 16:17:11

Soultrigger
Member
From: Brazil
Registered: 2021-11-04
Posts: 111

Post Hybernation Troubleshooting, (USB devices dissapear)

Hi Folks,

I am a noob at Linux, so I am sorry if this is too trivial. (I am not a native english speaker). I installed Arch the old way (guide), and did study many ways to organize my system boot/partition scheme. (I came from a Windows background, but I am using only Arch Linux in my system, by which I mean I am commited to learn and be free big_smile).

The issue I am having is that after suspend or hibernation it seems the hardware might be having issues powering the usb devices and the Kernel wisely chooses to turn off / unload those devices. (At least that is what I understood after googling a lot). In such searchs I came to this command

udevadm trigger

, but it doesnt seems to do anything in regards to rescan the usb devices and reload the drivers/devices or it might not do anything since I am using SystemD since the start (changed the hook UDEV for SYSTEMD).

My USB devices before hibernation looks like this:

lsusb                                                                                         ✔  12:23:16 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 045e:0b12 Microsoft Corp. Xbox Controller
Bus 001 Device 003: ID 320f:5055 Telink CIDOO V65
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 0bda:8771 Realtek Semiconductor Corp. Bluetooth Radio
Bus 003 Device 003: ID 046d:c539 Logitech, Inc. Lightspeed Receiver
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

After the reboot the Xbox Controller, Realtek bluetooth and the Logitech G604 will dissapear and all I know how to do is open terminal and type reboot to fix it. :'

Another issue is that the system fails to return from hybernation sometimes and since it might be related I will let you know how mkinticpio is, my partitions mount points and let you know I am using Luks2. (It might return, but not init the GPU anymore, since the led to show SSD/HDD reading lights up and turns off, and lights up again, it might be reading the storage devices and working just fails to show anything at the screen, when this happens I try to hist ctrl+alt+F3 and log with my user and password to type reboot, but I did not have any success. I dont know if there is anything I can try before hitting the reset button)

Mkinitcpio:

MODULES=(btrfs)
HOOKS=(base systemd plymouth autodetect modconf kms keyboard sd-vconsole sd-encrypt block filesystems fsck)

I know that Luks2 might have some issues with hybernation/suspend, but since it works most of the time I think systemD is handling it well. I didnt use the RESUME= argument for the kernel. I am also using the PCR 0+7 to validade a PIN when I load my system just to test how it works, but I am using the PIN with that check, instead the "main"password that I use when the PCR state cant be validated. (which seems to happen sometimes after it fails to return from hybernation and I hit reset).

My partiton scheme looks like this: (SDA is a SATA SSD and  SDB is a HDD)

NAME        FSTYPE      FSVER LABEL   UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                       
├─sda1      vfat        FAT32         9115-C36E                               866M    15% /efi
├─sda2      crypto_LUKS 2             c3ee957c-3131-4706-9ecd-aa365dee1dd5                
│ └─root    btrfs             root    8aa6253c-ef17-4ada-9caa-6f36167ab8b7  250,5G    71% /mnt/games
│                                                                                         /home
│                                                                                         /
└─sda3      vfat        FAT32         B6EC-8D77                                           
sdb                                                                                       
├─sdb1      crypto_LUKS 2             48c479d9-f61a-4b84-9ff0-07e5b3c46f5b                
│ └─storage btrfs             storage c1c9b477-c528-4491-b443-963e1c4385ab  434,2G    76% /mnt/vm
│                                                                                         /mnt/gameshdd
│                                                                                         /mnt/backup
│                                                                                         /mnt/arquivos
│                                                                                         /mnt/media
│                                                                                         /home/soultrigger/.cache
├─sdb2      crypto_LUKS 2             3b821399-fad7-4c0d-a066-b4979a628ec8                
│ └─var     btrfs             var     57bf5d10-b9f9-497c-8a69-c7b4c8db22de   22,6G    28% /var/cache
│                                                                                         /var/tmp
│                                                                                         /var/log
│                                                                                         /var/lib/portables
│                                                                                         /var/lib/machines
│                                                                                         /var
└─sdb3      crypto_LUKS 2             e32c634c-9188-4699-a3ec-d80ff0b8da1f                
  └─swap    swap        1             92ba8c70-ef4a-4d5f-b591-1363ca1848d7                [SWAP]

My swap is 32GB and I have 16 GB ram, so should be enough for a disk hybernation/suspend without issues.

So I do believe there might be a way to make Linux rescan devices, and that udevadm trigger might not work since I used systemD from the start to load them. But it might be a missconception I am having or I am using udevadm in the wrong way. But after some hours trying to search a way to do it, I am at a completely loss. (and I am looking over it for 3 months, and it is really making me mad, so I deciced to ask for help), I usually want to come here with something to be corrected, pointed in the right direction, but show that I really tried to learn and do it on my onw, but I am completely lost on this topic. Probably the main issue is that I dont know how to search this information in a proper way.

If there is a way to troubleshoot why the devices are failing to return gracefully or why it is failing sometimes to return from hybernation/suspend, can you point me in the right direction? (But the main issue is to restore the "lost"usb devices after it fails).

There is an optional request, I am using plymouth and I have to wait until SystemD loads the graphic driver and changes the resolutions before I type the Luks password or some characters might be missed during the resolution change, so I would like to know if there is a way to force systemD to load the "amdgpu" before plymouth. I probably would have to write a systemd unit (if that is how it is called the specific service configuration files), but there might be a way to handle this trough mkinitcpio, but I failed to find that regarding that. (I kind of found in the wiki how to make the driver to load early, but couldnt make it work or it worked but not in the order I was hoping to...).

I am reading some books about Linux, but the learning is slow since there is a lot to learn and the time to dedicated to that is more limited than I would like. I am using Arch because I love its simplicity, DYI aspect and the urge to learn how to use Linux to even use it. I couldnt adapt to any other diistros I ttried, but I feel at home with Arch. I did know each command of DOS and how to use it in advanced ways and I even did program back then, I did resist to go to Windows until W98 came out (main motivation was games), I didnt like the system and the programming aspect of it, so I became just a regular windows user without a care in the world.

I knew about Linux, but I had no easy access to it by that time, or I might have been using for more time since Linux did reignite my need to learn technology and I look forward to return to the programming world. I did flirt with linux for more than a decade, but now that I decided to flip the switch completely and use and learn all that I can about it. I just felt like letting you know a bit of the background and I am sorry for failing to find the answer on my own. (when I researched Luks, I tryed all that it can interact with such as LVM, RAID, and did several virtual machines to see what I would use on my reinstall of Arch and what would give me more knowledge - and it was cool to see how the Installation Guide changed from my first install to the current one).

Last edited by Soultrigger (2023-11-26 16:17:47)

Offline

#2 2023-11-26 22:11:15

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

Re: Post Hybernation Troubleshooting, (USB devices dissapear)

After the reboot the Xbox Controller, Realtek bluetooth and the Logitech G604 will dissapear and all I know how to do is open terminal and type reboot to fix it. :'

If we ignore the BT, re-plugging the controller/mouse does not reactivate them?

Another issue is that the system fails to return from hybernation sometimes and since it might be related I will let you know how mkinticpio is, my partitions mount points and let you know I am using Luks2. (It might return, but not init the GPU anymore, since the led to show SSD/HDD reading lights up and turns off, and lights up

For clarification: "hibernation" generally refers to S4. It's basically a power off and reboot, but instead of re-initializing everything, the kernel loads an image of the RAM before the S4 that was stored on a disk.
Are you talking about that or S3 "suspend to ram", which works much faster, but the system doesn't completely power down because it has to continously refresh the RAM?

You probably want to check the system journal around the suspend/hibernation - usb errors are going to show up there.
https://wiki.archlinux.org/title/System … ing_output

There is an optional request

Please don't create shopping list threads. They bloat the thread and make it hard to know what parts are solved (and for future readers: how)
systemd doesn't load anything here (but it starts plymouth)
If you want the GPU drivers to load as early as possibly, see https://wiki.archlinux.org/title/Kernel … _KMS_start

PS: "systemd", not "systemD"
Though I enjoy the image of lennart still getting all railed up about that, realistically he's probably over it  - and it's wrong.

Offline

#3 2023-11-29 13:52:29

Soultrigger
Member
From: Brazil
Registered: 2021-11-04
Posts: 111

Re: Post Hybernation Troubleshooting, (USB devices dissapear)

Seth, thanks for the reply and sorry for being late.

I am setting up the hybernation trough KDE, the issue of it failing sometimes and usb devices dissapearing are about the same no matter if I choose suspend, hybernation or hybernation hybrid.

I am using a usb extension (basically a cable with a male and female connector), and both mouse and controller goes trough BT. The mouse also supports a radio transceiver, but it also "dissapears".

I also tried to remove the devices and replug in the usb ports or even changing usb ports but my system doesnt seem to recognize them anymore, just after a reboot. Humm, maybe I should look in my Gigabyte UEFI if there is any options regarding sleep and usb ports. From my noobish point of view it is as if Linux doesnt trust those devices anymore, so it "kills" them until I reboot, but might be more hardware based issue.

I will try to learn to read the journal and see if I can figure anything about it when I get home.

I did try the KMS, but didnt work when I did (at least not before plymouth wich was the first hook after systemd, but I might have done it wrong and will try again, thanks).

Is there any magic command to force Linux to search for devices and load them again? I will try to figure out the root of the problem, but a workaround would be good.

PS: I thought I was giving it some justice for saying "systemD", but it makes sence, in *nix world it seems people prefer lower case, and I also adhered to that on folders and files creation.

Last edited by Soultrigger (2023-11-29 14:03:23)

Offline

#4 2023-11-29 14:42:08

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

Re: Post Hybernation Troubleshooting, (USB devices dissapear)

If physically re-plugging the device(s) doesn't work, rebinding the USB won't either.
The entire USB stack will be messed up and BT likely just another victim ("lsusb" shows you bt controller?) of that.

Remove all external USB devices, replace keyboard and mouse if you can, suspend, resume, check whether the USB still reponds.
Then introduce devices one-by-one and repeat until things break and you got the offender.

I am using a usb extension (basically a cable with a male and female connector)

That btw. could easily be the offender as well.

Offline

#5 2023-12-01 16:52:32

Soultrigger
Member
From: Brazil
Registered: 2021-11-04
Posts: 111

Re: Post Hybernation Troubleshooting, (USB devices dissapear)

It seems to be the cable, I didnt have any issues with the USB devices after that. (but small data, about 5 "woke ups" - still it would happen about 2 of those times).

The sixth time it woke up it failed to boot, I tried to read the log, but I hadnt the time to look it in detail. I will put here whatever I find useful when I get home. (I used jounalctl -b -1 to read)

This post is just to let you know how it is going. I am letting it occur by use rather than to force hybernation and try to interact with it (when I am afk it gets hybernated and so on).

I will mark this as Solved when I am done with the testing.

Last edited by Soultrigger (2023-12-01 16:54:10)

Offline

Board footer

Powered by FluxBB