Repository navigation
Detach the Thunderbolt controller around sleep on the MacBookPro14,1 - #15756
joshuahamsa wants to merge 1 commit into
Conversation
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryAdds a sleep hook for the MacBookPro14,1 that removes the Thunderbolt bridge before sleep and rescans the PCI bus after wake.
No actionable issues were found. Tests were inspected, not executed. Acknowledgment: joshuahamsa explicitly accepts USB-C/Thunderbolt devices disconnecting and reconnecting around sleep. Sleep with peripherals attached remains untested. Other T1 models are deliberately excluded because they are untested and may differ. Reviews (1) · Last reviewed commit: "Detach the Thunderbolt controller around..." · Reviewed by Greptile |
|
Reviewed by Claude Opus 5.5, with Codex Medium as a second opinion. Both read this change next to the open pull requests that address the same MacBookPro14,1 sleep failure. This isn't being taken further as a separate fix, because an older pull request already makes the same change more carefully. Neither model ran anything on a worker. A worker has no Alpine Ridge controller, and verifying a fix that won't be the one merged would be wasted work. #11570 makes the same change, and it is older. Before sleep it removes the Thunderbolt upstream ports, and after resume it rescans the bus. It installs on the 13,x and 14,x models, the 14,1 included, and it has been run on a 14,1. It also covers two cases this pull request doesn't. Both models found these in
#10758 is older still and handles the 14,1 another way: s2idle by default, plus a shim module. When there are competing fixes, the oldest is preferred unless a newer one is clearly better. This pull request isn't, so it gives way to them. Which of the two lands is for the maintainer to decide. Your report still matters to #11570. It shows on a second 14,1 that the machine hangs in the Next, this waits on the maintainer. |
The MacBookPro14,1 never wakes from a lid close, in deep or s2idle (#15630). Bisecting with
/sys/power/pm_testin deep:freezeranddevicesreturn,platformhard-hangs, and the journal ends atPM: suspend entry (deep). The Alpine Ridge Thunderbolt controller wedges the late suspend phase.This adds a system-sleep hook that removes the controller's upstream bridge (
8086:1578), and with it the whole Thunderbolt tree, before sleep, and rescans the PCI bus on wake. The hardware leaf installs it on the MacBookPro14,1 only, and a migration installs it on existing installs, leaving an existing hook alone.Deep sleep is kept, and the CPU idle states are untouched. This is an alternative for the 14,1 to the
mem_sleep_default=s2idle+intel_idle.max_cstate=1approach in #14409, which costs idle power all the time.Hardware validation (MacBookPro14,1, BIOS 529.140.2.0.0, Omarchy 4.0.4-1,
7.2.5-3-omarchy):install/hardware/apple/fix-suspend-thunderbolt.shfrom this branch, and a lid-close deep sleep of ~7.5 min resumed. The bridge is released beforePM: suspend entry (deep)and re-enumerated afterPM: suspend exit, with the TB NHI and xHCI back.Trade-off: anything on USB-C/Thunderbolt is disconnected and re-enumerated on every sleep. Sleeping with a peripheral attached is untested. Other T1 models (14,2, 14,3) are deliberately left out, because they are untested and may differ (#12194, #14409).
Tests:
test/shell.d/apple-thunderbolt-suspend-test.sh(hook against a fake PCI tree, the leaf's model gate, and the migration's install, preserve and no-sudo paths). The image-deferred-hardware, platform-setup, brcmfmac-supplicant and gb10-sleep tests also pass.