Skip to content

Fix suspend/resume on MacBookPro14,1 - #5970

Closed
erikwb wants to merge 1 commit into
omacom:quattrofrom
erikwb:apple-mbp14-suspend-s2idle
Closed

erikwb wants to merge 1 commit into
omacom:quattrofrom
erikwb:apple-mbp14-suspend-s2idle

Conversation

@erikwb

@erikwb erikwb commented May 24, 2026

Copy link
Copy Markdown

These 2017 Kaby Lake, non T1, Intel MacBook Pros fail to resume from the firmware default S3 or even s2idle sleep. Two changes make s2idle suspend reliable:

  • default mem_sleep to s2idle (via a limine-entry-tool drop-in)
  • blacklist the thunderbolt module, which otherwise blocks a clean resume

Wired into install/config/all.sh next to the existing apple fixes and scoped by DMI product name to MacBookPro14,1.

Copilot AI review requested due to automatic review settings May 24, 2026 23:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a MacBookPro14,1-specific workaround to improve suspend/resume reliability by switching the sleep mode to s2idle and blacklisting thunderbolt, and wires it into the overall install flow.

Changes:

  • Introduce fix-suspend-s2idle.sh to apply mem_sleep_default=s2idle and blacklist thunderbolt on MacBookPro14,1.
  • Invoke the new Apple suspend fix script from the main install/config/all.sh runner.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
install/config/hardware/apple/fix-suspend-s2idle.sh New hardware-specific script to apply s2idle + module blacklist on MacBookPro14,1.
install/config/all.sh Runs the new s2idle suspend fix during the full install configuration sequence.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +5
# Fix suspend/resume on MacBookPro14,1 (2017 13" Intel, no Touch Bar).
#
# This machine hangs or fails to resume from the firmware's default S3 ("deep")
# sleep. Two changes make s2idle suspend reliable:
# 1. Default to s2idle instead of deep (S3 is broken on this platform).
DROP_IN="/etc/limine-entry-tool.d/apple-mbp-suspend-s2idle.conf"
DEFAULT_LIMINE="/etc/default/limine"

if [[ ! -f $DROP_IN ]] || ! grep -q 'mem_sleep_default=s2idle' "$DROP_IN"; then
EOF
fi

if [[ -f $DEFAULT_LIMINE ]] && ! grep -q 'mem_sleep_default=s2idle' "$DEFAULT_LIMINE"; then
Comment on lines +33 to +41
cat <<EOF | sudo tee "$DROP_IN" >/dev/null
# Omarchy: default to s2idle suspend on MacBookPro14,1 (S3 is broken)
KERNEL_CMDLINE[default]+=" mem_sleep_default=s2idle"
EOF
fi

if [[ -f $DEFAULT_LIMINE ]] && ! grep -q 'mem_sleep_default=s2idle' "$DEFAULT_LIMINE"; then
sudo tee -a "$DEFAULT_LIMINE" < "$DROP_IN" >/dev/null
fi
This 2017 13" Intel MacBook Pro (no Touch Bar) fails to resume from the
firmware default S3 ("deep") sleep. Two changes make s2idle suspend
reliable:

  - default mem_sleep to s2idle (via a limine-entry-tool drop-in), since
    S3 is broken on this platform
  - blacklist the thunderbolt module, which otherwise blocks a clean
    resume

Wired into install/config/all.sh next to the existing apple fixes and
scoped by DMI product name to exactly MacBookPro14,1, the only model
this was verified on.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@erikwb
erikwb force-pushed the apple-mbp14-suspend-s2idle branch from 9ca4453 to 84ab18d Compare May 24, 2026 23:11
@erikwb

erikwb commented May 24, 2026

Copy link
Copy Markdown
Author

Most of copilot's suggestions look counter to convention in the other hardware scripts, but it does look prudent to just use the drop-in directory.

@omarchybot omarchybot added bug Something isn't working compatibility Make Omarchy work better on everything! labels Sep 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for working on this machine, @erikwb. There is now a second pull request fixing the same bug, and I think that one should be the one taken forward. So I have not run this one on a test machine, and it waits on the maintainer to decide.

The competing fix. #10758 fixes suspend on the MacBookPro14,1 too. Its investigation is in #10593. It also defaults to s2idle through a limine drop-in, but it keeps Thunderbolt working instead of turning it off: an out-of-tree module (tb-ar-shim-dkms, in omacom/omarchy-pkgs#349) restores the controller's PCI state across suspend. It targets quattro and ships a migration. #10758 has problems of its own (it depends on that package being published, and its detector and migration have gaps), so it is not ready either. But it goes after the cause, where this pull request switches the hardware off.

What I found in this pull request, at 84ab18d:

  • It targets dev. dev is now the 3.x upgrade path. New installs run from quattro, where these scripts live under install/hardware/ rather than install/config/hardware/. Merged as it is, this would not reach a current install.
  • Existing installs never get it. It is wired only into install/config/all.sh, with no migration, so a MacBookPro14,1 that already runs Omarchy would not change on update.
  • The blacklist probably does not stop the driver loading. install/login/limine-snapper.sh:5-6 on dev adds MODULES+=(thunderbolt) to the initramfs, and mkinitcpio loads those modules by name. A blacklist line in /etc/modprobe.d only stops loading by alias, so thunderbolt would most likely still load at boot on a default install. I worked this out from the source and have not tested it on hardware.
  • When the blacklist does work, it costs Thunderbolt entirely: docks, eGPUs and Thunderbolt storage stop working even while the machine is awake. The comment at fix-suspend-s2idle.sh:8-10 says USB-C USB and DisplayPort keep working. I could not confirm that, and it needs showing on the machine.

Both are right about s2idle: running limine-snapper.sh after the config stage does carry the drop-in into the boot entry, and running the script again changes nothing.

Checked: the diff, read against dev and quattro, with the competing #10758 and #9899 and issue #10593. No tests ran, because there was no point spending a test machine on a fix that should not be the one merged. Also, suspend on this model can only be checked on a real MacBookPro14,1. The second opinion (Codex, medium effort) got the three pull requests without my answer and also picked #10758. It raised the gaps in #10758 and the doubt about USB-C above. It can read my working notes, so its agreement is not guaranteed to be independent.

This waits on the maintainer to choose between the two approaches.

@omarchybot
omarchybot changed the base branch from dev to quattro September 28, 2026 05:52
@omarchybot

Copy link
Copy Markdown
Collaborator

This pull request now targets quattro, so I looked at it again against that branch. What I said before still holds, and it still waits on the maintainer to choose between it and #10758.

What changed with the retarget, at 84ab18d:

  • It does not apply to quattro as it stands. quattro moved the hardware fixes out of install/config/: the Apple scripts are called from install/hardware/all.sh:34-37 and live in install/hardware/apple/. This branch adds its line to install/config/all.sh, which on quattro no longer calls any hardware script, and GitHub reports the branch as conflicting. It would need porting to the new layout, plus a migration so existing installs get it.
  • The blacklist is even less likely to hold on quattro. etc/mkinitcpio.conf.d/thunderbolt_module.conf puts MODULES+=(thunderbolt) into every initramfs, and a blacklist line in /etc/modprobe.d does not stop a module loaded by name. That is from reading the source; it has not been tried on the hardware.

I did not port it or run it on a test machine, because the competing fix is still the one I would take forward. #10758 also defaults this model to s2idle, but keeps Thunderbolt working by fixing its suspend handling instead of switching it off, and it ships a migration. It is not ready either: it depends on the tb-ar-shim-dkms package being published, and it carries on silently if that module fails to load. #9899 goes after the same machines with a broader set of changes and is not what I would pick.

Checked: this diff, #10758 and #9899, read against quattro. Nothing was run, and suspend on this model can only be checked on a real MacBookPro14,1. The second opinion (Codex, medium effort) was given all three without my answer, also picked #10758, and raised the silent module-load failure in it. It can read my working notes, so its agreement is not guaranteed to be independent.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thank you for this, @erikwb. On quattro this no longer fits the file layout it was written for, and #10758 fixes the same MacBookPro14,1 suspend problem in a way that does, so the work continues there.

Closed at the maintainer's request. The review above has the details; it was done by Claude Opus 5.5 with Codex Medium as a second opinion, whose agreement is not independent.

@omarchybot omarchybot closed this Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working compatibility Make Omarchy work better on everything!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants