Suspend not working as expected, wakes up after 3-5 seconds?

So I installed Fedora 43 Workstation on a Thinkpad P16s and everything has been working pretty good-ish out the box. Apart from the suspend feature. I am using GNOME 49.2.

I’ve seen that this is an on going issue with suspend and have checked the previous posts with solutions but nothing worked for me. I did find this article in Fedora magazine here.

It’s quite a complicated thing for a new user of Linux to be expected to know about how this all works and I was just curious why the suspend feature doesn’t work or if there are any other work arounds?

I mean I don’t mind powering off my laptop if I HAVE to. But I wouldn’t mind being able to return to a previous state when I am working on certain things an have applications still running…

Is this just a GNOME thing? I am sure on a Niri session the suspend seems to work fine.

Suspend has been the #1 biggest problem for me since I switched to Linux a few years ago. It will work for a while, then break, then eventually work again. Suspend issues are very hardware specific and the hardware vendors don’t seem to prioritize getting it working with Linux the way they do Windows. I doubt it’s Gnome, it’s more likely to be the BIOS or kernel drivers for your hardware.

One thing you could try is updating your laptop’s system BIOS to the latest version in case they have fixed something there.

Beyond keeping your Fedora updated, I am afraid I don’t have much more that might help but I have been fighting similar issues so would like to see if others have suggestions.

Since it tends to be hardware specific, you might want to show us what hardware you have by posting the output of “inxi -Fzxx” here using the Preformatted text button. If inxi says command not found, you can install it with “sudo dnf install inxi”.

1 Like

I actually found a solution that works but I am fairly new to Linux myself so I am not sure if this was a good solution or safe solution?

I feel like the majority of the time tinkering with system files is going to break something hence why I say safe.

Fedora 43 Workstation
ThinkPad P16s Gen 2
6.18.6-200.fc43.x86_64
GNOME 49.3
GPU 1: NVIDIA RTX A500 Laptop GPU
GPU 2: Intel Iris Xe Graphics @ 1.50GHz [Integrated]

/etc/modeprobe.d/nvidia.conf:

# Disable Nvidia modesetting for hyprid graphics
options nvidia-drm modeset=0

# Enable dynamic power management
options nvidia NVreg_DynamicPowerManagement=0x02

# Disable GSP firmware (can cause issues on some laptops)
options nvidia NVreg_EnableGpuFirmware=0

# Preserve video memory allocations across suspend/resume
options nvidia NVreg_PreserveVideoMemoryAllocations=1

# Disable S0ix power management
options nvidia NVreg_EnableS0ixPowerManagement=0

I tried the systemctl enable nvidia commands for unmasking and enabling nvidia-suspend and hibernate and so fourth.

What worked for me was disabling USB and Thunderbolt wake:

# Disable XHCI (USB)
echo XHCI | sudo tee /proc/acpi/wakeup

# Disable TXHC (Thunderbolt)
echo TXHC | sudo tee /proc/acpi/wakeup

# Verify both are disabled
cat /proc/acpi/wakeup | grep -E "XHCI|TXHC"

Both should be *disabled - I have to use my laptop keyboard/trackpad to resume but I am fine with that so keep it in mind if you are not using a laptop.

I think that something was sending wake signals hence why I disabled those.

To make it permanent create a service for it:

/etc/systemd/system/disable-usb-wakeup.service:

[Unit]
Description=Disable USB wakeup to prevent spurious wake events
After=multi-user.target

[Service]
Type=oneshot
ExecStart=/bin/sh -c 'echo XHCI > /proc/acpi/wakeup; echo TXHC > /proc/acpi/wakeup'

[Install]
WantedBy=multi-user.target
sudo systemctl enable disable-usb-wakeup.service
sudo systemctl start disable-usb-wakeup.service

EDIT:

Also found the culprit which was the Logitech Receiver for my keyboard and mouse.

I first listed all USB devices:

lsusb

then checked which USB devices have wakeup enabled:

for device in /sys/bus/usb/devices/*/power/wakeup; do
  echo "$device: $(cat $device 2>/dev/null)"
done

for me this was /sys/bus/usb/devices/3-1/power/wakeup: enabled

so I disabled it:

echo disabled | sudo tee /sys/bus/usb/devices/3-1/power/wakeup

from what I found to make it permanent across reboots a udev rule needed to be created and added in:
/etc/udev/rules.d/90-usb-no-wakeup.rules

# Disable wakeup for Logitech Bolt Receiver to prevent spurious wake from suspend
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c548", ATTR{power/wakeup}="disabled"

# then reload udevadm controls
sudo udevadm control --reload-rules

Please anyone more informed let me know if this is good practice or just plain silly to do this. It works for now which is cool but if it is flaky then I’d love to hear an alternative.