Fix intermittent suspend hang on T2 MacBooks (force synchronous device suspend)#6149
Fix intermittent suspend hang on T2 MacBooks (force synchronous device suspend)#6149andyhoops wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses intermittent hard hangs during suspend on T2 MacBooks by forcing synchronous device suspend (setting /sys/power/pm_async=0) via a boot-time systemd oneshot service, and ensures existing installations receive the fix via a migration.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Changes:
- Add a T2-gated hardware script that installs/enables a systemd oneshot service to set
pm_async=0at boot. - Wire the new script into the standard install/config stage.
- Add a migration to apply the same fix to existing installs on update.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
migrations/1782742549.sh |
Runs the new Apple T2 suspend fix for existing installs via migration. |
install/config/hardware/apple/fix-suspend-async.sh |
New T2-detection script that installs/enables a oneshot systemd unit to set pm_async=0. |
install/config/all.sh |
Invokes the new Apple suspend async fix during install/config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Omarchy migration — apply the T2 synchronous device-suspend fix to existing | ||
| # installs. At submission time, RENAME this file to a fresh unix timestamp that | ||
| # is greater than the newest existing migration, e.g.: | ||
| # | ||
| # mv migration.sh "migrations/$(date +%s).sh" | ||
| # | ||
| # (Verify it sorts after the current latest in migrations/.) | ||
|
|
||
| echo "Fix intermittent suspend hang on T2 MacBooks (force synchronous device suspend)" | ||
|
|
||
| source $OMARCHY_PATH/install/config/hardware/apple/fix-suspend-async.sh |
There was a problem hiding this comment.
Done in 0fe6d3f — migration now leads with the echo like the others
| cat <<EOF | sudo tee /etc/systemd/system/omarchy-pm-async-suspend-fix.service >/dev/null | ||
| [Unit] | ||
| Description=Omarchy synchronous device-suspend fix for T2 MacBook | ||
|
|
||
| [Service] | ||
| Type=oneshot | ||
| ExecStart=/bin/bash -c 'echo 0 > /sys/power/pm_async' | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target | ||
| EOF |
There was a problem hiding this comment.
Added ConditionPathExists=/sys/power/pm_async in 0fe6d3f, thanks.
Refs: #1840
Problem
On T2 MacBooks,
systemctl suspend/ lid-close intermittently hard-hangs themachine the instant it enters suspend — black screen, dead keyboard/trackpad/
Touch Bar, no wake; only a forced power-off recovers. This is the core of the
widely-reported #1840 across many T2 models (13"/15"/16", 2018–2020).
Root cause
An asynchronous device-suspend race. The kernel default
(
/sys/power/pm_async=1) suspends devices in parallel; on T2 hardware thisraces and deadlocks.
pm_tracelocalises the hang to the async suspend core(
drivers/base/power/main.c), not to any single driver — which is whyunloading individual drivers (brcmfmac, apple-bce) and PCI D3cold tweaks don't
help. Forcing synchronous device suspend (
pm_async=0) eliminates the race.The existing
install/config/hardware/apple/fix-suspend-nvme.shdoes not coverthese machines: it excludes 16,x/15,x models and targets a discrete NVMe at PCI
0000:01:00.0, whereas 16,2-class storage is the T2-bridged ANS2 controller ate6:00.0. This fix is independent of that one.Fix
Add
install/config/hardware/apple/fix-suspend-async.sh: on T2 Macs(
lspci 106b:180[12]), install + enable a oneshot service that writes0to/sys/power/pm_asyncat boot. Mirrors the structure of the existingfix-suspend-nvme.sh. No change to mem_sleep / logind.conf / sleep.conf /bootloader cmdline is required.
Testing
linux-t27.0.12: 5/5 clean suspend/resumecycles with the fix vs 5/5 hard hangs without (same
deepmode). Lidclose/reopen confirmed. Persists across reboot.
no-op on hardware that wasn't racing.
Changes
install/config/hardware/apple/fix-suspend-async.sh(new)install/config/all.sh— add one line after thefix-suspend-nvme.shentry:run_logged $OMARCHY_INSTALL/config/hardware/apple/fix-suspend-async.shmigrations/<unix-timestamp>.sh(new) — sources the script so existinginstalls get it on
omarchy update.Note for reviewers
Gated to T2 Macs (where it's proven).
pm_async=0is harmless on non-racinghardware, so the gate could be widened to all Apple MacBooks (
#1840includes acouple of non-T2 reports) if preferred. Co-testers from #1840 on 13"/15" models
would help confirm breadth.