[SOLVED] Suspend (sleep to ram) turns off and immediately on again

Hello all,

I recently had the problem, that suspend would just immediately turn on again. After some trial and error I found the solution myself, but it was quite difficult, since I just transitioned from Windows.
So I thought I would post my solution here, if anyone happens to have the same problem and runs risk to break more things because of lacking experience (like me), instead of actually fixing the problem.

So as I already mentioned, my PC would suspend upon pressing the suspend button (or using systemctl suspend) but then immediately turn on again.
The problem hid itself inside /proc/acpi/wakeup. There you can see all the devices which are allowed/disallowed to wake your PC from suspend (as far as I understood it).
It probably looks something like this:

Device  S-state   Status   Sysfs node
GP12      S4    *enabled   pci:0000:00:07.1
GP13      S4    *enabled   pci:0000:00:08.1
XHC0      S4    *enabled   pci:0000:09:00.3
GP30      S4    *disabled
GP31      S4    *disabled
PS2K      S3    *disabled
PS2M      S3    *disabled
GPP0      S4    *enabled   pci:0000:00:01.1
GPP8      S4    *enabled   pci:0000:00:03.1
SWUS      S4    *enabled   pci:0000:05:00.0
SWDS      S4    *enabled   pci:0000:06:00.0
PTXH      S4    *enabled   pci:0000:02:00.0
PT20      S4    *disabled
PT23      S4    *disabled
PT24      S4    *disabled
PT26      S4    *disabled
PT27      S4    *disabled
PT28      S4    *disabled
PT29      S4    *enabled   pci:0000:03:09.0

Now I disabled the devices one by one (don't need to worry about the already disabled ones) to see which one was causing the problem (could theoretically be multiple ones).
You can do this by using echo DEVICE > /proc/acpi/wakeup, this will toggle the Statusfield (needs to be done in a root shell, use sudo -i beforehand).

If it is a PCI device you can also use echo disabled > /sys/bus/pci/devices/<port>/power/wakeup (this won't toggle the Statusfield, which was a problem for me).

Once you found the problematic device(s) you can make disabling it/them persistent over reboots by creating services.
For me GPP0 caused the problem, and I'll post my services as examples:
/etc/systemd/system/root-suspend.service:

[Unit]
Description=Local system suspend actions
Before=sleep.target

[Service]
Type=simple
ExecStart=/bin/sh -c "echo disabled > /sys/bus/pci/devices/0000:00:01.1/power/wakeup"

[Install]
WantedBy=sleep.target

/etc/systemd/system/root-resume.service:

[Unit]
Description=Local system resume actions
After=suspend.target

[Service]
Type=simple
ExecStart=/bin/sh -c "echo disabled > /sys/bus/pci/devices/0000:00:01.1/power/wakeup"

[Install]
WantedBy=suspend.target

Then you can enable and start the services

sudo systemctl enable root-suspend
sudo systemctl enable root-resume
sudo systemctl start root-suspend
sudo systemctl start root-resume


I hope this can help someone in the future :slight_smile:


Also: Would appreciate it if someone experienced could check that this actually makes sence (or if there's a better way).

4 Likes

Now that is something also happening to my device, I never bothered to fix it tho :joy: I'll try the mentioned solution soon, thanks for sharing :grin:
Oh, and welcome to the forum. A great first post! :hugs:

3 Likes

Just a tip, a nice “shortcut” for

is --now

When used with enable, the units will also be started. When used with disable or mask, the units will also be stopped. The start or stop operation is only carried out when the respective enable or disable operation has been successful.

sudo systemctl enable --now root-suspend
sudo systemctl enable --now root-resume

:slight_smile:

and
too :slight_smile:

2 Likes

Thanks :slight_smile:

And yep that's definitely handy :+1:

1 Like

Thanks

Let me know if it works for you as well :slight_smile:

I love to see a difficult issue resolved with a service. However, with this type of issue you should always try finding a cure with a bios update or alternate kernel first. Changing sleep states in your bios can also sometimes help.

Congrats on finding a fix, and welcome to the Garuda community. :wave:

5 Likes

Yeah, i checked in the bios, found no options for sleep states and was too lazy to update lol (would have been version 15 to 16c). I probably should do that in the future though.
Also I was too scared to change something with the kernel, but I'll keep that in mind, it seems to be a common thing to do :slight_smile:

1 Like

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