From c6fb136ae460609e004cff16d365e498f5f0ac2d Mon Sep 17 00:00:00 2001 From: Andy Hooper Date: Mon, 29 Jun 2026 15:23:12 +0100 Subject: [PATCH 1/2] Fix intermittent suspend hang on T2 MacBooks (force synchronous device suspend). Refs #1840 --- install/config/all.sh | 1 + .../hardware/apple/fix-suspend-async.sh | 30 +++++++++++++++++++ migrations/1782742549.sh | 11 +++++++ 3 files changed, 42 insertions(+) create mode 100644 install/config/hardware/apple/fix-suspend-async.sh create mode 100644 migrations/1782742549.sh diff --git a/install/config/all.sh b/install/config/all.sh index 0c3b839822..e17de875f2 100644 --- a/install/config/all.sh +++ b/install/config/all.sh @@ -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 diff --git a/install/config/hardware/apple/fix-suspend-async.sh b/install/config/hardware/apple/fix-suspend-async.sh new file mode 100644 index 0000000000..f1d8107a78 --- /dev/null +++ b/install/config/hardware/apple/fix-suspend-async.sh @@ -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 </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 + + chrootable_systemctl_enable omarchy-pm-async-suspend-fix.service + sudo systemctl daemon-reload +fi diff --git a/migrations/1782742549.sh b/migrations/1782742549.sh new file mode 100644 index 0000000000..3833fbf0d2 --- /dev/null +++ b/migrations/1782742549.sh @@ -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 From 0fe6d3f176b2c5aeae294cab6b4979943c584b44 Mon Sep 17 00:00:00 2001 From: Andy Hooper Date: Mon, 29 Jun 2026 17:12:04 +0100 Subject: [PATCH 2/2] Address review: clean migration header, guard service with ConditionPathExists --- install/config/hardware/apple/fix-suspend-async.sh | 1 + migrations/1782742549.sh | 8 -------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/install/config/hardware/apple/fix-suspend-async.sh b/install/config/hardware/apple/fix-suspend-async.sh index f1d8107a78..281da091da 100644 --- a/install/config/hardware/apple/fix-suspend-async.sh +++ b/install/config/hardware/apple/fix-suspend-async.sh @@ -16,6 +16,7 @@ if lspci -nn | grep -q "106b:180[12]"; then cat </dev/null [Unit] Description=Omarchy synchronous device-suspend fix for T2 MacBook +ConditionPathExists=/sys/power/pm_async [Service] Type=oneshot diff --git a/migrations/1782742549.sh b/migrations/1782742549.sh index 3833fbf0d2..b7471bbb17 100644 --- a/migrations/1782742549.sh +++ b/migrations/1782742549.sh @@ -1,11 +1,3 @@ -# 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