Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions install/config/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ run_logged $OMARCHY_INSTALL/config/hardware/framework/qmk-hid.sh

run_logged $OMARCHY_INSTALL/config/hardware/apple/fix-spi-keyboard.sh
run_logged $OMARCHY_INSTALL/config/hardware/apple/fix-suspend-nvme.sh
run_logged $OMARCHY_INSTALL/config/hardware/apple/fix-suspend-async.sh
run_logged $OMARCHY_INSTALL/config/hardware/apple/fix-t2.sh

run_logged $OMARCHY_INSTALL/config/hardware/lenovo/fix-yoga-pro7-bass-speakers.sh
Expand Down
30 changes: 30 additions & 0 deletions install/config/hardware/apple/fix-suspend-async.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Fix intermittent suspend hang on T2 MacBooks caused by async device suspend.
#
# On T2 Macs the kernel default of asynchronous (parallel) device suspend
# (/sys/power/pm_async=1) intermittently HARD-HANGS the machine the instant it
# enters suspend: black screen, dead keyboard/trackpad/Touch Bar, no wake, only
# a forced power-off recovers. pm_trace fingerprints the hang in the async
# device-suspend core (drivers/base/power/main.c), not in any single driver.
# Forcing synchronous device suspend serialises it and resolves the hang.
#
# Confirmed on MacBookPro16,2 (5/5 clean suspend cycles with the fix vs 5/5
# hangs without). Independent of suspend mode (deep or s2idle). See
# basecamp/omarchy#1840 for the broader set of affected T2 models.
if lspci -nn | grep -q "106b:180[12]"; then
echo "Detected MacBook with T2 chip. Applying synchronous device-suspend fix..."

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
Comment on lines +16 to +27

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added ConditionPathExists=/sys/power/pm_async in 0fe6d3f, thanks.


chrootable_systemctl_enable omarchy-pm-async-suspend-fix.service
sudo systemctl daemon-reload
fi
11 changes: 11 additions & 0 deletions migrations/1782742549.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 0fe6d3f — migration now leads with the echo like the others