OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
power-suspend critical occasional DISPUTE

Fix a total hang on the second suspend caused by Intel Wi-Fi firmware

archomarchyendeavouroscachyosmanjarolaptopintel
CORRECTED An auditor found the fix wrong or incomplete and rewrote it.
AUDIT NOTE

The problem is real and correctly described: basecamp/omarchy#8461 reports repeated "Failed to run INIT ucode: -110" after the first resume on ThinkPad X1 / Intel AX hardware, with a second suspend during the retry loop hanging the machine, and proposes both the sleep hook and enable_ini=N. The sleep-hook path and pre/post arguments match systemd-sleep(8). Two gaps make the fix miss on current hardware. First, newer Intel parts (BE200/BE201 and recent AX on current kernels) bind to iwlmld rather than iwlmvm, so modprobe -r iwlmvm iwlwifi fails with "Module iwlwifi is in use" and the hook silently does nothing. Second, options iwlwifi power_save=0 is the older knob: the effective one for MVM devices is iwlmvm power_scheme=1. The hook also has no error handling, so a failed unload is invisible.

The cause above was not rewritten and may still contain the error described. The fix below is the corrected version.
RISK

Scripts placed in /usr/lib/systemd/system-sleep/ sit in a package-owned directory and can be removed by a systemd upgrade. Re-check after major updates. Unloading iwlwifi drops any active VPN or network mount at suspend time.

Symptom

First suspend/resume is fine. The second suspend, often a lid close, hangs the machine completely and only a hard power-off recovers it. The journal is full of: iwlwifi 0000:00:14.3: Failed to run INIT ucode: -110 repeated dozens of times over 30 seconds before the freeze.

Cause

After the first resume the Intel Wi-Fi driver fails to reinitialise its firmware and enters an indefinite retry loop. When logind starts another suspend while that loop is running, the suspend never completes and the system deadlocks.

Fix

Check which sub-driver your card actually uses before writing the hook:


lsmod | grep -E '^iwl'

Unload whichever of iwlmvm/iwlmld/iwldvm is present, then iwlwifi, and log failures instead of swallowing them:


sudo tee /etc/systemd/system-sleep/iwlwifi.sh <<'EOF'
#!/bin/sh
case $1 in
  pre)
    /usr/bin/modprobe -r iwlmld iwlmvm iwldvm 2>/dev/null
    /usr/bin/modprobe -r iwlwifi || echo "iwlwifi unload failed" >&2
    ;;
  post)
    /usr/bin/modprobe iwlwifi
    ;;
esac
EOF
sudo chmod +x /etc/systemd/system-sleep/iwlwifi.sh

(/etc/systemd/system-sleep/ is the admin directory. /usr/lib/systemd/system-sleep/ also works but belongs to packages.)

Verify it runs and that the unload succeeds, because if NetworkManager holds the interface, the unload fails and the hook is useless:


systemctl suspend
journalctl -b -u systemd-suspend.service | grep -i iwl

If the unload fails, take the interface down first in the pre branch (nmcli radio wifi off) and bring it back in post.

For the modprobe options, set both: power_save is the iwlwifi-level knob, and power_scheme=1 is the one that matters for MVM/MLD devices:


# /etc/modprobe.d/iwlwifi.conf
options iwlwifi enable_ini=N power_save=0
options iwlmvm power_scheme=1

sudo mkinitcpio -P      # or sudo limine-mkinitcpio on Omarchy, only if iwlwifi is in the initramfs

Verify

Do three suspend/resume cycles in a row. journalctl -b -k | grep iwlwifi shows no Failed to run INIT ucode retry storm, and nmcli device shows the interface back up after each resume.

Sources

iwlwifi-hang-on-second-suspend