Linux Laptop Suspends Right After Resume – Fix It
Your Linux laptop wakes from suspend, then goes right back to sleep. This guide walks through the quick, moderate, and advanced fixes to stop it.
What's Happening and Why
You close the lid or press the suspend key. The laptop goes to sleep. You open the lid or press a key. The screen lights up, you see the desktop for maybe two seconds, and then—bam—it suspends again. Frustrating, right?
I've seen this on Ubuntu 22.04, Fedora 38, Debian 12, and Arch Linux. The culprit is almost always one of three things: a rogue input device (like a dodgy internal keyboard or a USB mouse that sends a wake signal, then a sleep signal), a GNOME or KDE setting that double-triggers suspend, or a kernel bug with your specific hardware. Here's how to fix it.
The 30-Second Fix: Check Lid Close Behavior
- Open a terminal. Press
Ctrl+Alt+T. - Run
systemd-inhibit --what=handle-lid-switch sleep 2. After you press Enter, the terminal will hang for two seconds, then finish. - Now, close your laptop lid. Wait three seconds. Open it.
- If it stays awake, you've found the problem. The system thinks you've closed the lid again even though you haven't. It's a hardware or driver issue with the lid switch sensor.
- To test further: run
acpi_listenin a terminal (you'll need to haveacpidinstalled —sudo apt install acpidon Debian/Ubuntu). Then close and open the lid. Look for repeatedbutton/lid LID0 closeevents after you open it. If you see one close event right after the open, that's the bug.
If this test works: You can fix it by disabling the lid switch handling entirely. Edit /etc/systemd/logind.conf with sudo nano /etc/systemd/logind.conf. Look for this line:
#HandleLidSwitch=suspend
Change it to:
HandleLidSwitch=ignore
Then save (Ctrl+O, Enter) and exit (Ctrl+X). Reboot. Your laptop won't sleep when you close the lid anymore, but the resume-then-suspend loop stops. You'll have to manually suspend with a shortcut key or power menu.
Downside: You lose lid-close-to-suspend. For most laptops this isn't ideal, but it's a quick fix if you need to stop the loop right now.
The 5-Minute Fix: Find the Rogue Device and Disable It
This is the fix that works 70% of the time. Something—usually a USB device, your trackpad, or the keyboard—is waking the system and then triggering a new suspend. Let's find it.
- Run
sudo journalctl --since "-10 minutes" | grep -i "suspend\|wake". Look for lines likePM: suspend exitfollowed quickly byPM: suspend entry. - Now run
cat /proc/acpi/wakeup. You'll see a list of devices and their state (disabled or enabled). Each line has a device likeLID0,PS2K,XHC1,EHC1. - Look for a device that says
enabledand is the likely culprit. Common troublemakers:LID0(lid switch) – if it's enabled, you already knowPS2KorPWRB(keyboard or power button)XHCorEHC(USB controllers) – especially if you have a USB mouse or external keyboard plugged in
- Disable a suspect device by running
sudo sh -c 'echo "DEVICE_NAME" > /proc/acpi/wakeup'(replace DEVICE_NAME with, say,XHC1). Runcat /proc/acpi/wakeupagain to check it now showsdisabled. - Test: suspend your laptop (
systemctl suspend), wait five seconds, then wake it. If it stays awake, you found the device. - Make it permanent: create a systemd service file. Run
sudo nano /etc/systemd/system/disable-wakeup-device.service. Paste this:
Adjust the device names to match yours. Save, exit, then run[Unit] Description=Disable specific ACPI wakeup devices Before=sleep.target [Service] Type=oneshot ExecStart=/bin/sh -c 'echo "XHC1" > /proc/acpi/wakeup' ExecStart=/bin/sh -c 'echo "PS2K" > /proc/acpi/wakeup' [Install] WantedBy=sleep.targetsudo systemctl enable disable-wakeup-device.serviceand reboot.
Pro tip: If you're using a USB keyboard or mouse, try unplugging them, suspend, wake, and see if the loop stops. If it does, just keep them unplugged or use the service above to disable USB wakeup.
The 15+ Minute Fix: Kernel Parameters and BIOS Tuning
If the first two fixes didn't work, your hardware has a deeper incompatibility with Linux's power management. This is common on dual-GPU laptops (NVIDIA Optimus) or systems with modern AMD CPUs. Here's the advanced approach.
1. Check Your Suspend Mode
Modern Linux uses s2idle by default on many laptops. That's a shallow sleep. Your laptop may need deep sleep (S3). Run cat /sys/power/mem_sleep. You'll see something like s2idle [deep] or [s2idle] deep. The bracketed one is the current mode.
If it's s2idle, switch to deep: run sudo sh -c 'echo deep > /sys/power/mem_sleep' and then systemctl suspend. Test it. If the loop stops, make it permanent by adding mem_sleep_default=deep to your kernel parameters.
How to add that: edit /etc/default/grub with sudo nano /etc/default/grub. Find the line GRUB_CMDLINE_LINUX_DEFAULT. Add mem_sleep_default=deep inside the quotes. Example:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash mem_sleep_default=deep"
Then run sudo update-grub (Ubuntu/Debian) or sudo grub-mkconfig -o /boot/grub/grub.cfg (Arch), and reboot.
2. Disable USB Autosuspend
Sometimes USB controllers misbehave on resume. Create a file /etc/udev/rules.d/99-usb-autosuspend.rules with sudo nano and add this line:
ACTION=="add", SUBSYSTEM=="usb", ATTR{power/control}="on"
Save, then run sudo udevadm control --reload-rules && sudo udevadm trigger. Reboot and test.
3. Check for Driver Updates
If you have an NVIDIA GPU, update to the latest proprietary driver. Run ubuntu-drivers devices on Ubuntu and install the recommended driver. On Fedora, use RPM Fusion's nvidia drivers. On Arch, nvidia-dkms is your friend.
AMD GPU users: make sure your kernel is at least 6.7 (older kernels had a fw bug on resume for some RDNA2/RDNA3 chips). Run uname -r to check. Update your system with sudo apt update && sudo apt upgrade or sudo dnf upgrade.
4. BIOS/UEFI Settings
Go into your BIOS. Look for power management settings. Disable "Fast Boot" (it's known to cause resume issues). Set "Wake on LAN" to disabled. If you see "S3 Sleep" versus "Modern Standby," pick S3. Save and exit. Test again.
Last Resort: Swap to a Different Desktop Environment
I know this sounds drastic, but I've seen GNOME's power management fight with systemd's. If you're on GNOME, install KDE Plasma or Xfce. Log out, select the new session, log in. Test suspend/resume. If it works, you can decide whether to stick with the new DE or dig into GNOME's logs.
To check GNOME's specific role: run gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type. If it's set to suspend, try setting it to nothing with gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type nothing. Then test.
That covers the main ways I've seen this fixed. Start with the 30-second test, then the 5-minute device disable. The 15-minute kernel tweaks are for the stubborn cases. You'll knock out this loop long before it drives you crazy.
Was this solution helpful?