Repository navigation
Keep Thunderbolt USB-C xHCI awake on Intel MacBooks - #7044
shawnyeager wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds an Apple Intel Thunderbolt USB‑C xHCI “keep awake” workaround by installing a udev rule and wiring it into both the installer and migrations.
Changes:
- Add a new Apple hardware config script that installs a udev rule for Intel JHL6540 (8086:15d4).
- Add a migration that applies the same fix via sourcing the config script.
- Run the new fix as part of the global hardware configuration flow.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| migrations/1786836656.sh | New migration to apply the Thunderbolt USB‑C xHCI wake workaround. |
| install/config/hardware/apple/fix-tb-usb-wakeup.sh | New installer script that writes a udev rule and triggers it. |
| install/config/all.sh | Hooks the new Apple workaround into the standard install sequence. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The rule matches ACTION=="add", but udevadm trigger sends "change" unless told otherwise, so on an existing install the migration wrote the rule and left the controller free to suspend until the next boot's coldplug. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
xhci_pci's probe calls pm_runtime_allow() on Alpine Ridge controllers (XHCI_DEFAULT_PM_RUNTIME_ALLOW), so any probe after the add event -- a rebind, which is how the controller is recovered, or a remove and rescan around suspend -- put power/control back to auto. Matching bind as well writes it again once the driver is attached. Co-Authored-By: Codex Medium <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed, with two fixes pushed to your branch. The approach holds, and there's one question below for the maintainer. Pushed
Checked
The unplug bug itself needs a JHL6540 MacBook, so it was not reproduced here. Your report is the only evidence so far. Codex Medium gave a second opinion over two rounds. It found the Open
|
|
Reviewed a4caa97. Running the leaf with Checked
Codex Medium reviewed the new commit and the whole PR, and found nothing. It agreed with the conclusions above, and since it can read this session's working files, that agreement is not guaranteed to be independent. Waiting on @shawnyeager, or anyone with a 2016–2017 MacBook Pro that has the JHL6540 controller ( git fetch https://github.com/shawnyeager/omarchy fix-macbook-tb3-usb-hotplug
git checkout a4caa97e026ec580a94fe3853a9f159f1d8b5b62
bash install/config/hardware/apple/fix-tb-usb-wakeup.sh
grep . /sys/bus/pci/devices/*/power/control | grep -f <(lspci -Dnd 8086:15d4 | cut -d' ' -f1)The last line should print The |
Summary
On Intel MacBooks whose USB-C ports sit behind an Intel JHL6540 Thunderbolt 3 xHCI controller (
8086:15d4), the controller runtime-suspends into D3cold after a device is unplugged. The next plug-in never enumerates — no kernel USB event, no/dev/sd*, nothing for udiskie to mount — untilxhci_hcdis rebound.This is separate from
usbcore.autosuspend(already disabled byusb-autosuspend.sh). The PCI device itself is asleep.Fix
install/config/hardware/apple/fix-tb-usb-wakeup.shpower/control=onandd3cold_allowed=0on8086:15d4install/config/all.shfor fresh installs1786836656.shapplies the same script on existing machinesTested
Reproduced on Omarchy 4 /
MacBookPro14,3(2017 15" T1):enable=0,runtime=suspendedpower/control=onand an xhci rebind/dev/sdaNotes
T2 Macs use different Thunderbolt silicon and already have their own suspend path. This only matches JHL6540 (
8086:15d4).