Fixing “System Wakes Immediately After Suspend” on Linux

Root cause: Mediatek MT7921E Wi-Fi driver preventing suspend

Overview

Some Linux systems equipped with Mediatek MT7921/MT7922 Wi-Fi + Bluetooth cards fail to remain suspended.
When you attempt systemctl suspend, the machine briefly enters sleep and then instantly wakes back up.

Typical kernel logs show:

mt7921e 0000:05:00.0: PM: failed to suspend async: error -110
PM: Some devices failed to suspend, or early wake event detected

The mt7921e driver is known to hang during suspend, causing an “early wake”.
Additionally, missing Bluetooth firmware (BT_RAM_CODE_MT7922_1_1_hdr.bin) can trigger related messages.


Symptoms

  • System resumes seconds after suspend.
  • Journal entries include: mt7921e ... failed to suspend async: error -110 PM: Some devices failed to suspend, or early wake event detected
  • Bluetooth firmware load errors: bluetooth hci1: firmware: failed to load mediatek/BT_RAM_CODE_MT7922_1_1_hdr.bin

Root Cause

The mt7921e kernel module times out while entering the suspend state, preventing the system from completing S3 sleep.
As a result, the kernel aborts the suspend operation and immediately resumes power management — appearing as if the system “woke up by itself.”


Workaround: Unload the Driver Before Suspend

To allow clean suspend, the driver can be automatically unloaded before sleep and re-loaded after resume.

Step 1 – Create a systemd service

sudo tee /etc/systemd/system/mt7921e-sleep.service >/dev/null <<'EOF'
[Unit]
Description=Unload Mediatek mt7921e Wi-Fi before suspend and reload after resume
Before=sleep.target
StopWhenUnneeded=yes

[Service]
Type=oneshot
ExecStart=/usr/sbin/modprobe -r mt7921e
ExecStop=/usr/sbin/modprobe mt7921e
RemainAfterExit=yes

[Install]
WantedBy=sleep.target
EOF

Step 2 – Enable the service

sudo systemctl daemon-reload
sudo systemctl enable mt7921e-sleep.service

Step 3 – (Optional) Remove legacy hook script

If an old /etc/systemd/system-sleep/mt7921e.sh script exists, remove it:

sudo rm -f /etc/systemd/system-sleep/mt7921e.sh
sudo systemctl daemon-reload

Optional Improvements

Install Updated Firmware

Newer Mediatek firmware may resolve suspend issues:

sudo apt update
sudo apt install firmware-misc-nonfree

Disable Bluetooth (if unused)

echo "blacklist btusb" | sudo tee /etc/modprobe.d/blacklist-btusb.conf

Force Deep Sleep Mode

Ensure the kernel uses S3 “deep” instead of s2idle:

sudo sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="mem_sleep_default=deep /' /etc/default/grub
sudo update-grub

Verification

After configuration:

systemctl suspend
  • The system should remain suspended until you press a key or power button.
  • On resume, verify in logs: journalctl -u mt7921e-sleep.service You should see: Started Unload Mediatek mt7921e Wi-Fi before suspend and reload after resume

Summary

ComponentAction
mt7921e Wi-Fi driverUnload before suspend
Systemd integrationmt7921e-sleep.service
Old hook removalDelete /etc/systemd/system-sleep/mt7921e.sh
Optional firmwarefirmware-misc-nonfree package
Optional Bluetooth fixBlacklist btusb if unused

Result: System now performs stable suspend-to-RAM.
Wi-Fi reconnects automatically on resume, and no further early-wake events appear in logs.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.