Repository navigation
Conversation
The 2017 13" MacBook Pro breaks Thunderbolt on every lid-close suspend: two Linux PCI suspend bugs plus an EFI behavior that disables the Thunderbolt root port when S3 is entered with a device attached (cold boot to recover). Install the tb-ar-shim-dkms carry for the kernel-side bugs and default the machine to s2idle via a limine cmdline drop-in so the EFI path can never fire, with a migration for installed systems. Validated end-to-end on a MacBookPro14,1: module autoloads by PCI modalias, mem_sleep comes up s2idle, suspend cycles clean at 1.3 s. Investigation: omacom#10593 Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014SjBV8RAyo6et6LMmurU9W
ece8c0c to
3149440
Compare
Temporary [FOR-UPSTREAM] DKMS carry of the tb_ar_shim module, which fixes suspend/resume of the Alpine Ridge Thunderbolt 3 controller on the Apple MacBookPro14,1 (omacom/omarchy#10593). Same shape as qmk-hid/tzupdate: a "source": "local" PKGBUILD fetching the tag tarball from the module's own repo, https://github.com/orospakr/linux-apple-alpine-ridge-suspend, with a git_tags upstream provider so sync-upstream opens version bumps. The module source, README, the drivers/pci/quirks.c patch headed to linux-pci, and the CI that builds the module against Arch linux/linux-lts headers all live in that repo; omarchy-pkgs carries only the PKGBUILD and metadata. Validated on MacBookPro14,1: 28/28 suspend cycles across both sleep modes, 1.3-1.4 s resumes; the module installed via pacman, dkms-built, cold-boot autoload verified. The companion detector/install script/migration is omacom/omarchy#10758. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_014SjBV8RAyo6et6LMmurU9W
Temporary [FOR-UPSTREAM] DKMS carry of the tb_ar_shim module, which fixes suspend/resume of the Alpine Ridge Thunderbolt 3 controller on the Apple MacBookPro14,1 (omacom/omarchy#10593). Same shape as qmk-hid/tzupdate: a "source": "local" PKGBUILD fetching the tag tarball from the module's own repo, https://github.com/orospakr/linux-apple-alpine-ridge-suspend, with a git_tags upstream provider so sync-upstream opens version bumps. The module source, README, the drivers/pci/quirks.c patch headed to linux-pci, and the CI that builds the module against Arch linux/linux-lts headers all live in that repo; omarchy-pkgs carries only the PKGBUILD and metadata. Validated on MacBookPro14,1: 28/28 suspend cycles across both sleep modes, 1.3-1.4 s resumes; the module installed via pacman, dkms-built, cold-boot autoload verified. The companion detector/install script/migration is omacom/omarchy#10758. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_014SjBV8RAyo6et6LMmurU9W
|
Reviewed at 3149440 by Claude Opus 5.5, with Codex Medium as a second opinion. Both read this diff against Competing fixes. #11570 targets the same failure on the same machines with Findings in this diff:
Nothing in the detector or scripts runs on other hardware: both gate on the exact DMI model and the What happens next. This waits on the maintainer to choose the 14,1's sleep policy between this and #11570, and on omacom/omarchy-pkgs#349 being published before it can merge. If this approach is chosen, it cannot be marked verified until someone other than its author confirms it on a 14,1 at the final head. |
|
@orospakr a data point that may matter for defaulting the 14,1 to s2idle (a heads-up, not an objection). On a MacBookPro14,3 (i7-7820HQ, Sunrise Point-H) the package never goes deeper than PC3 under Linux, awake or in s2idle, including on a stock unpatched Arch kernel. macOS on the same hardware reaches package C7/C10. I have not tested a 14,1, and it has a different PCH (Sunrise Point-LP), so this may not apply. To check on the 14,1 before making s2idle the default: Or compare battery charge before/after an hour in s2idle. If the 14,1 reaches PC8+ in s2idle, ignore this. |
Review fixes from the pull request: - pre stops any thunderbolt-remove-rescan-retry-* unit still running from the previous resume. Nothing stopped it before, so a sleep starting within about 15 s of a resume could have a retry rescan bring back the tree pre had just removed, and that tree would then go into S3 live. - The hook acts only when /sys/power/mem_sleep selects deep, which systemd-sleep writes before it runs the hooks, and post acts only if pre did. In s2idle the platform firmware does not cut the controllers' power, so removing the tree there only dropped attached USB-C devices on every sleep. This also keeps the hook out of the way on a MacBookPro14,1 that defaults to s2idle (omacom#10758). suspend-then-hibernate is still not covered. - The mounted-device guard also reads /proc/swaps, so a side carrying active swap is not removed. - The migration installs the hooks unconditionally, so a copy the user carries is also reset to root:root 0755. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
An update to the earlier review, at the same head (3149440), because #11570 has changed since. Re-read by Claude Opus 5.5 against #11570 at 936d96b, with Codex Medium as a second opinion. Nothing was run: this needs a MacBookPro14,1. The two no longer conflict by default. The earlier review said this pull request and #11570 should not land unchanged together, because #11570's hook also ran under s2idle and would remove the upstream bridge that Unchanged. The findings in the earlier review still apply at this head: What happens next. This waits on the maintainer to choose the 14,1's sleep policy, and on omacom/omarchy-pkgs#349. It cannot be marked verified until someone other than its author confirms it on a 14,1 at the final head. |
|
A follow-up at the same head (3149440), on the overlap @jandrusk raised. Read by Claude Opus 5.5 against #14409 at 98a8df5, #14692 at dff49a6 and #11570 at 936d96b, with Codex Medium as a second opinion; Codex reached the same conclusions, and that agreement may not be independent. Neither is a competing fix for this one. #14409 fixes a different bug on the same machine: the Apple S3X NVMe ( If this and #14409 both land on a 14,1, neither breaks the other. They write separate Limine drop-ins ( On the sleep policy. #14409 is a second 14,1 report in which Unchanged from the earlier reviews: the unpublished What happens next. This waits on the maintainer to choose the 14,1's sleep policy across this pull request, #11570 and #14409, and on omacom/omarchy-pkgs#349. It cannot be marked verified until someone other than its author confirms it on a 14,1 at the final head. |
|
Independent MacBookPro14,1 validation of the proposed shim, including the first suspend after a cold power-on. Tested November 8, 2026 on a 2017 13-inch, two-Thunderbolt-3-port MacBookPro14,1, Omarchy 4.5.0-3, systemd 262.1, linux-omarchy 7.2.15-1. The same USB-C hub and Realtek RTL8153 Gigabit Ethernet adapter remained attached. I built the unmodified tb-ar-shim-dkms 1.0.0-1 recipe from omacom/omarchy-pkgs#349 at f6aa10a69ab7b06ccf92b87f6b99200ebcfb68ae. The v1.0.0 source archive passed the recipe's SHA-256 check. DKMS built it for both installed kernels; runtime testing covered 7.2.15-1-omarchy only. For the module tests I retained s2idle, loaded both tb_ar_shim and the normal thunderbolt driver, and replaced my earlier PCI-removal/driver-unload hook with camera/display handling only. No bridge rescan ran during the module tests. The final configuration had no Thunderbolt blacklist or D3cold override.
The three module cycles used automatic RTC wake. Both modules autoloaded after the cold power-on, and the first test in that boot started with zero completed suspends. All Thunderbolt-subtree d3cold_allowed attributes were 1 for the clean final test. An isolated kernel trace measured from machine_suspend end to thaw_processes end, excluding time asleep, unlock, and link/DHCP reconnection. Each module cycle logged configuration saved for seven devices and no spent restore budget or old inaccessible-controller/resume-timeout messages. In the first post-boot cycle, the shim's own resume_noirq message reported 1505 us; that is a different, narrower measurement than the 0.5322 s device-resume result. The USB controller and hub were not removed/disconnected by the sleep hook. Screen wake was quick. After the first post-boot resume, a bounded For context, before these repairs deep sleep with the hub attached left the Alpine Ridge USB controller absent and RP05 inaccessible in D3cold. Ethernet fell back to 480M USB despite a 1 Gbps cable link, measuring 34.3 MB/s (~275 Mbps). Cold power-on restored USB 3. My intermediate hook/D3cold workaround fixed that locally, but the shim now matches its wake timing without the Thunderbolt blacklist, controller-removal hook, or power override. Limits: one machine, three module suspend cycles, one first-suspend-after-cold-boot check. This is separate from the author's 28-cycle evidence. No Thunderbolt dock/eGPU/tunneled-PCIe peripheral was available; the kernel logged I'm withdrawing my older hook-based proposal #9899 in favor of this module approach. This is hardware validation of the proposed module, not a claim that the current installer/migration in this PR was run unchanged: my s2idle policy is a systemd |
The installer runs hardware setup against the live ISO's offline pacman.conf, so every package a hardware leaf adds must be in install/omarchy-other.packages. tb-ar-shim-dkms was not, and since quattro moved to linux-omarchy neither is linux-headers, so omarchy-pkg-add failed on every MacBookPro14,1 and stopped the install. The installer pacstraps linux-omarchy-headers, which DKMS builds against, as it already does for macbook12-spi-driver-dkms, so the leaf no longer asks for the stock kernel's headers. The migration keeps linux-headers: it runs online and before 1789325478, which leaves an upgraded machine's stock kernel installed as a fallback. The test checks that whatever the leaf adds stays available offline. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-Authored-By: Codex Medium <[email protected]>
AGENTS.md keeps a single model's quirk behind omarchy-hw-match on its DMI name rather than a new public omarchy-hw-* command, so the model check moves inline with the existing Alpine Ridge PCI ID check and bin/omarchy-hw-macbookpro14-1 goes away. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Reviewed again after @tcholewa's MacBookPro14,1 test, by Claude Opus 5.5 with Codex Medium and muse-wonder (thinking high) as second opinions. I pushed two small fixes to this branch, so the head is now 818b712. The fix itself was not run: it needs a MacBookPro14,1. What I pushed
@tcholewa's test is the first evidence from someone other than the author that the shim works on a 14,1. They used the unmodified omacom/omarchy-pkgs#349 recipe, ran three s2idle cycles plus a first suspend after a cold power-on, and kept the hub and Ethernet at full speed. By their own account it did not run this pull request's installer or migration, so it supports the shim rather than confirming this head. They have also closed #9899 in favour of this approach. Competing fixes, as they now stand. This is the oldest open fix for the 14,1's Thunderbolt resume failure. Both reviewers would keep it as the 14,1's approach over the newer #11570 and #15756, which keep Still open
What happens next. This waits on the maintainer: to choose the 14,1's sleep policy across this, #11570 and #14409, and on omacom/omarchy-pkgs#349. It cannot be marked verified until it is confirmed on a 14,1 at 818b712 by the issue's reporter or a maintainer. The reporter is also this pull request's author, so in practice that means a maintainer. |
[Medium impact] The PR appears safe to merge; the previous migration issue is fixed and no new actionable issues were found. SummaryAdds Thunderbolt suspend support for
Reviews (2) · Last reviewed commit: "Keep the MacBookPro14,1 migration's PCI ..." · Reviewed by Greptile |
omarchy-migrate runs every migration under bash -euo pipefail. With grep -q, grep exits at the first match, lspci can die of SIGPIPE while still writing, and pipefail turns that into a failed check: the migration skips the fix on the very machine it targets and is still marked applied, the failure 1786137597 had to repair for the T2 check. Reading all of lspci's output with grep >/dev/null avoids it. The installer runs its hardware leaves without pipefail, so its copy of the check is unaffected. The test runs the migration under the runner's flags against an lspci stub that keeps writing past the pipe buffer after the match. Flagged by Greptile's review of 818b712. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Reviewed again after Greptile's review of 818b712, by Claude Opus 5.5, with Codex Medium and muse-wonder (thinking high) as second opinions. Greptile's one finding was real, so I pushed a fix and the head is now 2219504. What I pushed. Where it ran. On a disposable Omarchy worker, the new test failed 3 of 3 runs with What happens next. Nothing else has changed since my last comment, and the items listed there are still open. This still waits on the maintainer: to choose the 14,1's sleep policy, and on omacom/omarchy-pkgs#349 being published. It also needs confirmation on a 14,1 at this head before it can be marked verified. |
Enables working lid-close suspend on the 2017 13″ MacBook Pro (MacBookPro14,1), non-Touchbar so no T1. Companion to the
tb-ar-shim-dkmspackage PR in omarchy-pkgs; full investigation in #10593.The problem: every suspend breaks Thunderbolt on this machine — two Linux PCI bugs (garbage config-space restore after S3; skipped restore on s2idle), plus an Apple EFI behavior where entering S3 with anything in a Thunderbolt port makes the firmware disable the Thunderbolt root port until the next cold boot. The EFI part is unfixable from the OS, which is why the machine must default to s2idle (s2idle never executes the EFI S3 resume script).
What this adds:
bin/omarchy-hw-macbookpro14-1— detector: exact DMI product match +lspcicheck for the Alpine Ridge bridge (8086:1578). Gates on 14,1 alone because that's the validated machine; 14,2/14,3 share the controller and can be added once tested.install/hardware/apple/fix-thunderbolt-suspend.sh(+all.shentry) — installslinux-headers+tb-ar-shim-dkms, loads the module immediately (the modalias coldplug has already passed on a live system), and writes a limine cmdline drop-in withmem_sleep_default=s2idle(thefix-t2.shmechanism).migrations/1788811585.sh— same for already-installed machines, with thelimine-mkinitcpiorebuild guard so the cmdline reaches the boot entries.Validation: this exact flow ran end-to-end on a MacBookPro14,1 — package install, dkms build, detector match, drop-in + UKI rebuild, then a cold boot: module autoloaded by modalias,
mem_sleepcame up[s2idle], and suspend cycles are clean at ~1.3 s resume (vs 75–107 s with dead Thunderbolt before).test/shellpasses (the two failures on this machine, locate/snapper, pre-exist on master).Depends on the omarchy-pkgs PR publishing
tb-ar-shim-dkms— draft until that lands.🤖 Generated with Claude Code
https://claude.ai/code/session_014SjBV8RAyo6et6LMmurU9W
Fixes #10593