Skip to content

usb: dwc3: apple: defer host USB3 PHY routing until xHCI reset completes - #3144

Merged
DjDeveloperr merged 2 commits into
mainfrom
fix/usb3-wake-rxdetect
Nov 25, 2026
Merged

DjDeveloperr merged 2 commits into
mainfrom
fix/usb3-wake-rxdetect

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

What: Route the host USB3 PHY only after xHCI's reset (USBCMD.HCRST) has completed on the dummy PIPE producer, instead of before dwc3_host_init(). HCRST landing in a live SuperSpeed handshake wedged downstream hubs after deep sleep (PORTSC 0x0a0002b0, PR=1, PLS=Rx.Detect). That triggered #2274 Type-C replugs and restarted the external DP alt-mode display on 5/10 J714s wakes. The glue now routes from xHCI's SuperSpeed setup and gets the result back, so a failure still stops the core and the USB2-only fallback keeps working.

Tested: J714s (M5 Pro, T6050) at 40f74425e1a92ab6d7684113b518933c461c0c31: 10/10 RTC deep-sleep cycles at dmesg -n 5 with WD2 held. 0/10 stuck 0x0a0002b0 warm resets, 0/10 #2274 replugs, 0/10 DP-2 restarts; Dell 0bda:0409 + 0bda:5409 back first try 10/10; eDP-1, DP-2, DP-5 connected 10/10; GPU live before and after 10/10; no error-priority kernel line that a control at 79bbbb35 on the same kernel config and DTB doesn't also log. Host tests (atc-t8132-usb3, dwc3-initial-role, atc-usb3-tests + mutations, neo-stability-tests + mutations, atc-cio-sleep-tests, apple-dcp) and checkpatch.pl --strict pass.

Risk: two-way · all Apple DWC3 hosts (M1–M5: t8103/t6000/t6020/t8112/t8122/t8132/t6040/t8142/t6050). Gadget mode and T6040 still route before xHCI, as before. The usbcore/xhci-plat part is an opt-in used only by a dwc3 glue with usb3_host_route; other platforms are unchanged.

Not yet: hardware at this head on M1–M4 and base M5 (T8103/T6000/T6020/T8112/T8122/T8132/T8142). The J773g (M4, T8132) row in the comments is at 79bbbb35, before the follow-up. The older ports' USB2-only fallback and the T8132/T8142 P3 quirk are covered by host tests only.

Details

Root cause

dwc3_apple_set_role() enabled SUSPHY and called phy_set_mode(usb3_phy, PHY_MODE_USB_HOST) before dwc3_host_init(). That moved the PIPE mux from the dummy producer (0x42) to the live USB3 PHY (0x10) before xhci_plat_probe() ran, so the SuperSpeed port went straight into Rx.Detect / Polling.LFPS with the partner. Milliseconds later, usb_add_hcd(primary) ran xhci_reset() in the middle of that handshake.

  • With a quiet console (dmesg -n 5, as on normal desktop boots), HCRST landed inside the Dell S2725QC Realtek 0bda:0409 hub's handshake on about 40% of wakes. The hub stayed at PORTSC2 = 0x0a0002b0 with no receiver termination until #2274 replugged the port, which dropped DP-2 HPD.
  • With loglevel=7, synchronous console output shifted HCRST out of that window (0/56 failures), which hid the race.

Fix

  • dwc3_apple_set_role() leaves a host's USB3 routing owed (dwc3_apple_usb3_mode_before_start()) and keeps SUSPHY clear, so xhci_reset() runs on the dummy PIPE. Gadget mode and T6040, which pulses GUSB3PIPECTL.PHYSOFTRST before xHCI, still route first.
  • xHCI's SuperSpeed root hub leaves the USB3 PHY alone. usb_add_hcd() honors a shared HCD's own skip_phy_initialization, and xhci-plat sets it from xhci_plat_priv.skip_usb3_phy_init. dwc3 sets that for a glue with the usb3_host_route op.
  • dwc3 calls usb3_host_route from xHCI's init_quirk for the shared HCD. That is after xhci_reset() and dwc3_xhci_plat_start() (SUSPHY on) and before xhci_run() sets USBCMD.RS. An error fails the probe before the controller runs.
  • dwc3_apple_route_usb3() keeps the old policy: T8132/T6050 errors stop the host, other ports warn and run USB2 only with both root hubs up, and T8132/T8142 stay out of P3.
  • dwc3_apple_host_start() makes xHCI's probe synchronous (device_attach() when the driver core left it asynchronous) and returns the routing result. When xHCI didn't bind, it calls dwc3_host_exit(), so dwc3_apple_init() stops the core, skips the host state, the USB_SLP_DDR vote and syscore, and -ENOLINK still arms sleep_phy_pending. The op routes only in the task holding the glue lock there, so an asynchronous, late or rebind probe routes nothing, and a probe is never repeated once the PIPE has moved.
  • #2274's dwc3_apple_ss_check() / tipd_port_replug() fallback is unchanged, for hubs that really are dead.
  • Host tests: atc-t8132-usb3 models platform_device_add() and xhci_plat_probe() as they behave, with five negative controls. dwc3-apple-state-test covers the routing policy helper.
Evidence

J714s RTC deep sleep (rtc0 +25 s, mem = deep, dmesg -n 5, WD2 held)

Kernel Cycles Stuck 0x0a0002b0 / #2274 replugs DP-2 restarts Dell 0409 + 5409 first try
origin/main baseline 10 5 / 10 5 / 10 5 / 10
79bbbb35 (first commit), earlier run 10 0 / 10 0 / 10 10 / 10
79bbbb35, control on this setup 5 0 / 5 0 / 5 5 / 5
40f74425 (head) 10 0 / 10 0 / 10 10 / 10

Head run, per wake: the SuperSpeed hub (usb 4-1, 0bda:0409) enumerated +0.27–0.32 s after suspend exit, DP-2 was back at +0.97–1.31 s and never dropped again, and dwc3_apple_ss_check() found the SuperSpeed device at +5.3–5.5 s (TEST: SuperSpeed device back after the sleep 10/10). Suspend counters: 10 successes, 0 failures. Wi-Fi associated +8.0–8.2 s after every wake. Bluetooth was powered 10/10. WD2 (wdt + reconfig) came back armed with 29 of 30 s after every sleep and closed cleanly. GPU: LIVE vulkaninfo=1 dispatch=1 kernel=ok before and after every cycle, crashed=0, quarantined=0.

  • Build: native on the J714s at -j18, incremental. Configuration: the default kernel's /proc/config.gz. 0 errors, and no warnings in the changed files. The follow-up hooks (dwc3_apple_usb3_host_route, dwc3_xhci_plat_init_quirk) are in the build, and post_usb3_host_start is gone. The trial booted the head's t6050-j714s.dtb (WD2 wdt + reconfig) with the default Stage 2 and command line, MTE on and SEP writes enabled.
  • Error-priority kernel lines in the head run: 154 lines in 19 classes, every class also logged by the 79bbbb35 control with the same configuration and DTB. They are DCP provider clock index 0 and AFK service-matching lines, mmc0 card power, PCIe and Centauri D0 power-state lines, the glue's genpd_prepare returns -11 syscore retry on the dock's controller, the Centauri country update (-125), and Realtek HID "no listeners".
  • After every run the Mac went back to its default kernel with all 253 ESP files byte-identical, and the trial modules were removed.

Host tests at 40f74425

  • tools/asahi/run-host-tests.py: apple/atc-t8132-usb3 (13/13, including five negative controls that each have to fail on their own check), apple/dwc3-initial-role (1/1), atc-usb3-tests + --mutations (2/2), neo-stability-tests + mutations and old-revision controls (11/11), atc-cio-sleep-tests (1/1). apple-dcp: 95/95 (on clang 23, which needs -Wno-unused-but-set-global for existing test globals).
  • scripts/checkpatch.pl --strict --git origin/main..HEAD: 0 errors, 0 warnings, 0 checks for both commits.

dwc3_apple_set_role() currently enables SUSPHY and calls
phy_set_mode(usb3_phy, PHY_MODE_USB_HOST) before dwc3_host_init().
Routing the PIPE mux from the dummy producer to the live USB3 PHY
before xhci_plat_probe() runs allows the SuperSpeed link to start
Rx.Detect / Polling.LFPS immediately, and xhci_reset() (USBCMD.HCRST)
then hits milliseconds later in the middle of that handshake.

With a quiet console (dmesg -n 5), HCRST lands inside the partner's
initial LFPS window often enough to leave downstream SuperSpeed hubs
(such as the Dell S2725QC's 0bda:0409 hub on DP alt mode) wedged with
PORTSC stuck at 0x0a0002b0 (PR=1, PLS=Rx.Detect) and no receiver
termination, triggering a Type-C DISC replug that drops DP HPD and
restarts the external display. Even on wakes that survive HCRST, link
training stalls ~100 ms before retrying Polling instead of completing on
the first handshake.

Leave host-mode USB3 PHY routing to xHCI's shared SuperSpeed root hub
(usb_add_hcd() on xhci->shared_hcd), mirroring how USB2 host mode is
already left to the primary root hub. Keep SUSPHY clear while
usb_add_hcd(primary) executes xhci_reset() on the dummy PIPE producer;
dwc3_xhci_plat_start() enables SUSPHY once HCRST completes and before
usb_add_hcd(shared) calls phy_set_mode(usb3_phy, PHY_MODE_USB_HOST) and
xhci_run() starts the controller. Add a post_usb3_host_start glue hook
in dwc3_xhci_plat_start() so controllers that must keep their USB3 PHY
out of P3 (T8132/T8142) still disable U3 SUSPHY right after the shared
HCD finishes routing the PIPE, including when xhci-plat is loaded as a
module. Preserve pre-xHCI routing for gadget mode and for T6040, which
pulses GUSB3PIPECTL.PHYSOFTRST before xHCI starts.

Extend dwc3-apple-state-test and atc-t8132-usb3 (with a negative
control) to cover the deferred host USB3 routing policy.

Signed-off-by: Diljit Singh <[email protected]>
@DjDeveloperr
DjDeveloperr requested review from a team as code owners November 25, 2026 09:40
@github-actions github-actions Bot added blast:all Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Merge readiness at 40f74425: not ready yet

Check Detail
CI at head no failing: pr-text / pr-text
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes no requested by satchlj
Hardware row at head ok in the PR body at 40f74425
Conflicts ok not computed yet
PR text ok Risk: two-way · all Apple DWC3 hosts (M1–M5: t8103/t6000/t6020/t8112/t8122/t8132/t6040/t8142/t6050). Gadget mode and T6040 still route before xHCI, as before. The usbcore/xhci-plat part is an opt-in used only by a dwc3 glue with usb3hostroute; other platforms are unchanged.

Areas: area:gpu

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verdict: FINISH, then merge at 79bbbb3580ec

Blockers:

  1. drivers/usb/dwc3/dwc3-apple.c (dwc3_apple_set_role() / dwc3_apple_init()): deferring host phy_set_mode(usb3_phy, PHY_MODE_USB_HOST) into xhci_plat_probe() -> usb_add_hcd(xhci->shared_hcd) silently breaks error propagation and core_exit teardown on T8132 and T6050. dwc3_host_init() (drivers/usb/dwc3/host.c) only calls platform_device_add(xhci), whose device_add() -> bus_probe_device() -> device_initial_probe() (drivers/base/dd.c) returns void and swallows any xhci_plat_probe() failure. When usb_phy_roothub_set_mode() fails on xhci->shared_hcd (for example a T8132 BIST/PIPE timeout, a T6050 PIPE fault -EIO, or -ENOLINK from combo_usb3_mode()), xhci_plat_probe() tears down both HCDs and leaves dwc->xhci unbound, yet dwc3_host_init() still returns 0. dwc3_apple_init() then skips dwc3_apple_core_stop(), calls phy_reset(appledwc->usb2_phy), records appledwc->state = DWC3_APPLE_HOST, votes apple_sleep_usb_slp_ddr(true), and registers syscore while the controller has no bound xHCI driver and an undefined PIPE state; post-sleep -ENOLINK also stops reaching dwc3_apple_start_after_sleep() to arm sleep_phy_pending.
  2. tools/testing/selftests/drivers/apple/atc-t8132-usb3.py: the updated dwc3_host_init() mock hides blocker 1 by returning phy_set_mode()'s error directly instead of modeling platform_device_add() returning 0 on xhci_plat_probe() failure, and the apple,t8103-dwc3 fallback case was switched from DWC3_APPLE_HOST to DWC3_APPLE_DEVICE. On older non-fixed Type-C ports (t8103/t6000/t6020/t8112/t8122), bypassing dwc3_apple_set_role()'s host-mode USB2-only warning means any persistent phy_set_mode() error inside usb_add_hcd(xhci->shared_hcd) tears down the primary USB2 HCD as well (xhci-plat.c goto put_usb3_hcd) while dwc3_host_init() still returns 0.

Checked: diff, USB core HCD and xhci-plat probe ordering, driver core platform_device_add error semantics, atcphy_usb3_set_mode and T6050 combo_usb3_mode error paths, dwc3_apple_init and post-sleep -ENOLINK handling, and host-test harness assumptions.

Evidence
  • drivers/usb/dwc3/host.c: dwc3_host_init() calls platform_device_add(xhci); bus_probe_device() -> device_initial_probe() (drivers/base/dd.c) returns void, so a failed xhci_plat_probe() does not return an error from dwc3_host_init().
  • drivers/usb/host/xhci-plat.c + drivers/usb/core/hcd.c: usb_add_hcd(xhci->shared_hcd) calls usb_phy_roothub_set_mode(..., PHY_MODE_USB_HOST_SS) then PHY_MODE_USB_HOST; any non-zero error jumps to err_usb_phy_roothub_power_on and xhci-plat.c jumps to put_usb3_hcd, tearing down both HCDs and failing xhci_plat_probe().
  • drivers/usb/dwc3/dwc3-apple.c: dwc3_apple_init() relies on a non-zero return before dwc3_host_init() (or from dwc3_host_init()) to run dwc3_apple_core_stop(), avoid appledwc->state = DWC3_APPLE_HOST / apple_sleep_usb_slp_ddr(true) / dwc3_apple_syscore(true), and propagate -ENOLINK to dwc3_apple_start_after_sleep().
  • drivers/usb/dwc3/host.c dwc3_xhci_plat_start(): note that if xhci-plat is built as a loadable module and probes asynchronously after dwc3_apple_init() returns, dwc3_apple_post_usb3_host_start() also updates dwc->dis_u3_susphy_quirk without holding appledwc->lock.
  • tools/testing/selftests/drivers/apple/atc-t8132-usb3.py: dwc3_host_init() returns ret from phy_set_mode() directly, so assert(dwc3_apple_init(&a, DWC3_APPLE_HOST) == -ETIMEDOUT) passes only in the mock, not against real platform_device_add().

@github-actions github-actions Bot added the changes-requested A reviewer requested changes (bot) label Nov 25, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

PASS on J773g (M4, T8132, G16G B0) at 79bbbb3580ec08d4aae044f028754fa1460a86c6 for USB enumeration and RTC s2idle. Booted 7.3.0-ARCH-m4pr3144 with modular dwc3-apple and xhci-plat.

Check Result
USB at boot and after each wake All four DWC3 controllers and four ATC PHYs bound. The two active xHCI hosts each exposed a 480 Mb/s and a 10 Gb/s root hub. The Apple hub (05ac:800b) and SanDisk drive (0781:5567) both enumerated at 480 Mb/s, matching production. Zero xHCI/DWC3 probe failures or stuck warm resets. Both SuperSpeed ports read 0x0a0002a0 (reset clear) at boot and after all three wakes.
Sleep and desktop rtcwake -d /dev/rtc1 -m freeze -s 10 completed 3/3 times in the same boot. Suspend counters advanced from 0/0 to 3 successes/0 failures. Wi-Fi SSH returned after each wake, with wld0 up, the display manager active and zero failed units.
Kernel errors The six boot error messages matched production. Each candidate cycle logged the same two DWC3 genpd_prepare returns -11 messages and two Type-C cable-revalidation errors as one control cycle on 7.3.0-ARCH-m4mainefed1ae3.
Borealis aurora-g16 reached READY. After the third wake, gpubench-vk passed render.light and compute.light, with zero GPU faults, recoveries or hang kills.

The tether stayed connected throughout. Both downstream devices were USB2, so downstream SuperSpeed link recovery remains unverified on this setup. The candidate exposed only s2idle in mem_sleep. Restored the production kernel, removed the candidate modules and verified the desktop and Wi-Fi with zero failed units.

Leaving the host USB3 PHY routing to usb_add_hcd() on xHCI's shared HCD
moved it into xhci_plat_probe(), whose result platform_device_add()
does not report. A failed routing tore down both root hubs while
dwc3_host_init() returned 0: dwc3_apple_init() then recorded a host
with no bound xHCI, skipped dwc3_apple_core_stop(), voted
USB_SLP_DDR, and an -ENOLINK after a sleep no longer reached
dwc3_apple_start_after_sleep(). On older Type-C ports, a USB3 PHY
error took the USB2 root hub down with it instead of leaving the port
on USB2. The T8132/T8142 P3 quirk also ran from a probe that a
modular or asynchronous xhci-plat may run outside the glue lock.

Keep the USB3 PHY off the SuperSpeed root hub instead: let a shared
HCD skip its PHYs when it asks for it, and let xhci-plat ask for that
when the platform glue sets up the USB3 PHY itself. dwc3 asks for it
when its glue has a usb3_host_route op, which replaces
post_usb3_host_start and runs from xHCI's init_quirk for the shared
HCD: after xhci_reset() and dwc3_xhci_plat_start(), before xhci_run(),
the same point the routing ran at before. Its error fails the probe
before the controller runs.

In the Apple glue, that op routes with the error policy
dwc3_apple_set_role() had: T8132 and T6050 failures stop the host,
other ports warn and run USB2 only with both root hubs up. It acts only
in the task that runs dwc3_apple_host_start() under the glue lock.
dwc3_apple_host_start() binds xHCI itself when the driver core left
the probe asynchronous, does not probe again once the PIPE has moved,
and returns the routing's result, so that dwc3_apple_init() stops the
core on any failure.

Model platform_device_add() and xhci_plat_probe() in atc-t8132-usb3
the way they behave, with T8132 -ETIMEDOUT, T6050 -EIO and -ENOLINK,
the T8103 USB2-only fallback, asynchronous and late probes, and
negative controls for routing before xhci_reset(), routing from the
root hub, a lost error, a probe repeated on the live PIPE and a probe
outside the glue lock.

Signed-off-by: Diljit Singh <[email protected]>
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Thanks for the review, satchlj. Both blockers are fixed in 40f74425, a follow-up commit on 79bbbb35 (no force push).

1. Error propagation, core_exit and the USB2-only fallback

  • xHCI's SuperSpeed root hub no longer touches the USB3 PHY. usb_add_hcd() now honors a shared HCD's own skip_phy_initialization, and xhci-plat sets it from xhci_plat_priv.skip_usb3_phy_init. dwc3 sets that only for a glue with the new usb3_host_route op, so no other platform changes.
  • The glue routes the PHY from xHCI's init_quirk for the shared HCD. That runs after xhci_reset() and dwc3_xhci_plat_start() and before xhci_run(), the same window the first 10/10 run measured. A routing error fails the probe before RS is set.
  • dwc3_apple_host_start() reads the routing result itself. When xHCI didn't bind, it calls dwc3_host_exit() and returns that error. dwc3_apple_init() then runs dwc3_apple_core_stop() and skips state = HOST, the USB_SLP_DDR vote and syscore. -ENOLINK reaches dwc3_apple_start_after_sleep() again and arms sleep_phy_pending.
  • dwc3_apple_route_usb3() keeps the old set_role() policy as it was: T8132 and T6050 errors stop the host, other ports warn "USB2 only". Since the root hub no longer calls phy_set_mode(), xHCI keeps both root hubs up even when the PHY keeps failing.

Locking with a modular or asynchronous xhci-plat: post_usb3_host_start is gone. The route op acts only in the task that holds appledwc->lock inside dwc3_apple_host_start(). Any other probe (async, a late module load, a rebind) gets -EBUSY and routes nothing. dwc3_apple_host_start() finishes a probe the driver core left asynchronous with device_attach(), and returns -EPROBE_DEFER when no xHCI driver is registered yet. It never probes again once the PIPE has moved, because that would run HCRST on the live PIPE.

2. Tests

  • atc-t8132-usb3 now models platform_device_add() returning 0 whatever xhci_plat_probe() does. The model's HCRST asserts that the PIPE isn't live, and it tracks RS.
  • Cases:
    • T8132 -ETIMEDOUT and T6050 -EIO: core_stop, the error returned, no host state.
    • T6050 -ENOLINK through dwc3_apple_start_after_sleep(): sleep_phy_pending set.
    • apple,t8103-dwc3 in DWC3_APPLE_HOST with a failing PHY: both root hubs stay up, USB2 only.
    • T6040, asynchronous and foreign-task probes, no xHCI driver yet, and a failure after routing (no re-probe).
  • Five negative controls, each of which has to fail on its own check: routing before dwc3_host_init(), routing from the root hub, a lost error, a re-probe on the live PIPE, and a probe outside the glue lock.
  • dwc3-apple-state-test is unchanged, because its helper didn't change.

J714s at 40f74425: 10/10 RTC deep-sleep cycles at dmesg -n 5 with WD2 held: 0/10 stuck 0x0a0002b0 warm resets, 0/10 #2274 replugs, 0/10 DP-2 restarts. The Dell 0bda:0409 + 0bda:5409 hubs came back first try 10/10, all three displays were connected 10/10, and the GPU was live before and after every cycle. There is no error-priority kernel line that a 79bbbb35 control with the same kernel config and DTB doesn't also log.

Evidence
  • Per wake: the SuperSpeed hub enumerated +0.27–0.32 s after suspend exit, and DP-2 was back at +0.97–1.31 s and never dropped again. The hub check found the SuperSpeed device 10/10. Suspend counters: 10 successes, 0 failures. WD2 came back armed with 29 of 30 s after every sleep.
  • Build: native on the J714s, configured from the default kernel's /proc/config.gz, booted with the head's J714s DTB (WD2 wdt + reconfig). MTE was on and SEP writes were enabled. Afterwards the default kernel was restored with all 253 ESP files byte-identical.
  • Control: 79bbbb35 on the same setup, 5/5 clean. Every error-priority line class of the head run (DCP clock/AFK, PCIe/Centauri D0, mmc0, the glue's genpd_prepare -11 syscore retry, Realtek HID) appears there too.
  • run-host-tests.py: atc-t8132-usb3 13/13, dwc3-initial-role, atc-usb3-tests + mutations, neo-stability-tests + mutations, atc-cio-sleep-tests, apple-dcp 95/95. checkpatch.pl --strict --git origin/main..HEAD: 0/0/0.

@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) ci-failing A check failed at the PR head (bot) labels Nov 25, 2026

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verdict: MERGE at 40f74425e1a9

Blockers: none

Checked: Full diff across all 11 files (+472/-52), follow-up commit 40f74425e1a9 addressing both prior requested changes on 79bbbb3580ec, synchronous xHCI attach and routing error propagation in dwc3_apple_host_start(), shared HCD skip_phy_initialization opt-in in hcd.c / xhci-plat.c / dwc3/host.c, dwc3_apple_route_usb3() policy preserving T8132/T6050 strict failures and older-port USB2-only fallback, T6040/gadget pre-start routing preservation, updated host tests, exact-head J714s 10/10 deep-sleep verification row, and live CI status. Untested scope: no local kernel boot on Apple Silicon hardware (userspace code and CI audit only).

Evidence
  • Follow-up commit 40f74425e1a9 resolves both blockers from 79bbbb3580ec:
    • dwc3_apple_host_start() ensures synchronous xHCI probe (device_attach() if left async) and returns the stored usb3_host_route result, calling dwc3_host_exit() when xHCI fails to bind so dwc3_apple_init() cleanly tears down the core and propagates -ENOLINK / -EIO / -ETIMEDOUT.
    • dwc3_apple_route_usb3() runs from xHCI's init_quirk for the shared HCD after xhci_reset() and dwc3_xhci_plat_start() and before xhci_run(), preserving USB2-only fallback on older ports (t8103/t6000/t6020/t8112/t8122), strict failure on t8132/t6050, and P3 avoidance on t8132/t8142.
    • tools/testing/selftests/drivers/apple/atc-t8132-usb3.py and drivers/usb/dwc3/dwc3-apple-state-test.c cover both sync/async attach and error teardown paths.
  • Live CI at 40f74425e1a9: 9/9 checks passing (0 active, 0 failing), including DWC3/ATC builds, host-tests, kunit, rust-build, source-checks, pr-text, and readiness.
  • Exact-head J714s (M5 Pro, T6050) 10/10 RTC deep-sleep cycle verification reported in PR body at 40f74425e1a9.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J773g (T8132, G16G B0) at 40f74425e1a92ab6d7684113b518933c461c0c31 — FAIL on the zero-probe-error check. USB enumeration, RTC sleep and Borealis passed on 7.3.0-ARCH-m4pr3144r2.

Check Result
Boot At 2.466 s DWC3 logged 412280000.usb: Failed to initialize host, ret=-517 (-EPROBE_DEFER). xHCI registered its first bus on that controller at 2.626 s. Neither production boot log contained the error. No explicit phy_set_mode() error appeared.
USB and sleep Both 10 Gb/s root hubs enumerated at boot and after all 3/3 RTC wakes. Both SuperSpeed ports read 0x0a0002a0 each time. Zero stuck warm resets or failed suspends. After every wake, enumeration matched production, wld0 was up, the display manager was active and zero units had failed.
Wake diagnostics Each cycle logged two DWC3 genpd_prepare returns -11 messages and two Type-C cable-revalidation errors, matching the production control cycle.
Borealis render.light and compute.light passed after the third wake. Zero GPU faults, recoveries or hang kills.

Only s2idle was exposed. The Apple hub and SanDisk drive both ran at 480 Mb/s, leaving downstream SuperSpeed recovery untested. Restored 7.3.0-ARCH-m4mainefed1ae3, removed the candidate modules and verified desktop, Wi-Fi and zero failed units.

@DjDeveloperr
DjDeveloperr merged commit 7dde851 into main Nov 25, 2026
9 of 12 checks passed
@RyanTheTide
RyanTheTide deleted the fix/usb3-wake-rxdetect branch November 27, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) blast:all Macs affected, from Merge risk (bot) changes-requested A reviewer requested changes (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants