Repository navigation
Conversation
[Medium impact] The change reaches the suspend and resume workflow on opted-in MacBook8,1 systems. The PR still needs fixes for the documented setup commands and the removal check for persistent deep sleep. FindingsSummaryAdds experimental, opt-in SPI recovery for MacBook8,1 deep sleep.
|
| require_model() { | ||
| [[ $(cat /sys/class/dmi/id/product_name 2>/dev/null) == "MacBook8,1" ]] || fail 'Only MacBook8,1 is supported' | ||
| } | ||
| require_root() { (( EUID == 0 )) || fail 'Run via omarchy setup macbook81-s3 (sudo required)'; } |
There was a problem hiding this comment.
A normal desktop user running the documented omarchy setup macbook81-s3 enable command hits require_root and exits without installing anything. The router uses plain exec; requires-sudo=true does not request elevation. The documented disable command fails the same way. Use sudo inside the command for privileged work so both advertised commands work.
| require_model | ||
| require_root | ||
| # Do not leave boot-time deep mode enabled without a restore hook. | ||
| if grep -RsEq 'mem_sleep_default=deep' /etc/limine-entry-tool.d /etc/kernel 2>/dev/null; then |
There was a problem hiding this comment.
If a user saves mem_sleep_default=deep in /etc/default/limine, this check passes and disable removes the recovery hook. That file is a supported source of the kernel command line, but the search skips it. The temporary switch to s2idle leaves the boot setting unchanged, so deep sleep returns after reboot without SPI recovery and can leave the keyboard and trackpad unusable after suspend. Check /etc/default/limine before allowing removal.
| if grep -RsEq 'mem_sleep_default=deep' /etc/limine-entry-tool.d /etc/kernel 2>/dev/null; then | |
| if grep -RsEq 'mem_sleep_default=deep' /etc/default/limine /etc/limine-entry-tool.d /etc/kernel 2>/dev/null; then |
Summary
Add an opt-in, MacBook8,1-only SPI LPSS state recovery hook for deep/S3 suspend. This is a follow-up to the in-tree SPI PIO workaround in #9735, not another implementation of PIO or an automatic change to the default sleep mode.
On the 2015 12-inch MacBook (
MacBook8,1), the SPI controller can lose its Intel LPSS private register state across S3. The hook unloadsapplespi, unbinds the SPI PCI driver, snapshots nine LPSS registers before deep suspend, then restores the controller's state and rebinds/reloadsapplespiafter resume.Scope and safety
MacBook8,1model gate,deepmode check, and requiredinitcall_blacklist=dw_pci_driver_initin the running cmdline.0000:00:15.4. No Bluetooth UART MMIO changes and noiomem=relaxedrequirement.omarchy setup macbook81-s3 enableinstalls the hook but does not switch froms2idletodeepor make deep persistent.s2idlefor that suspend. If SPI does not recover, it switches back tos2idleuntil reboot.Physical hardware evidence (the source integration PoC, not this extracted PR)
On a real MacBook8,1 (Early 2015), Omarchy edge runtime commit
9f98609, kernel7.2.15-2-omarchy, with SPI PIO:PM: suspend entry (deep)/PM: suspend exitcycles in the journal.0000:00:15.4andapplespi OK after deep S3for every cycle.Existing integrated PoC and original recovery sources: https://github.com/geeknees/omarchy/tree/macbook81/poc-2026-11
Limitations: This isolated PR branch has not been installed and revalidated on fresh hardware. Battery drain is not quantified. Bluetooth reconnection after deep sleep is outside scope. Other models and kernels are untested.
s2idleshould remain the default.Verification
bash test/shell.d/macbook81-s3-test.sh: mockresource0test for allowlist, malformed snapshots, inactive controller, 9-register save/restore.bash -nfor setup command and system-sleep hook,git diff --check.Existing work