Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
31 changes: 31 additions & 0 deletions install/config/hardware/apple/fix-suspend-async.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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
ConditionPathExists=/sys/power/pm_async

[Service]
Type=oneshot
ExecStart=/bin/bash -c 'echo 0 > /sys/power/pm_async'

[Install]
WantedBy=multi-user.target
EOF

chrootable_systemctl_enable omarchy-pm-async-suspend-fix.service
sudo systemctl daemon-reload
fi
3 changes: 3 additions & 0 deletions migrations/1782742549.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
echo "Fix intermittent suspend hang on T2 MacBooks (force synchronous device suspend)"

source $OMARCHY_PATH/install/config/hardware/apple/fix-suspend-async.sh