Skip to content

usb: typec: tipd: don't leave M1/M2 Type-C ports deferred when the USB4 router never binds - #327

Merged
RyanTheTide merged 2 commits into
aurora-wipfrom
fix/m1m2-typec-usb4-router
Oct 16, 2026
Merged

RyanTheTide merged 2 commits into
aurora-wipfrom
fix/m1m2-typec-usb4-router

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

On the M1 Pro (t600x) and M2 (t8112), every CD321x Type-C connector in our devicetree links port@2 to its USB4 router. cd321x_register_port() waits for the router's Thunderbolt switch with fwnode_typec_thunderbolt_switch_get(), which returns -EPROBE_DEFER until USB4_APPLE_SOC registers it. Our published and linux-aurora configs have CONFIG_USB4 off. So with our DTB, every linked PD controller stayed deferred forever: no Type-C ports, no partners, no USB role switching, no DP alt mode, and no charging partner. Only the connector-less MagSafe controller bound.

The fix keeps deferring while the driver core still waits for missing dependencies. Once driver_deferred_probe_check_state() gives up, it registers the port without a switch, the same as a connector with no router link. Ports whose router registers in time are unchanged.

  • 7fd578b19 usb: typec: tipd: Stop waiting for a USB4 router that never binds (Fixes: fc76d0f20c29)
  • 6b59e8a69 usb: typec: tipd: Add KUnit tests for the USB4 router lookup (fail before, pass after)

Testing (hardware, 2026-10-16)

M1 Pro (j316s) and M2 (j413), aurora DTB, one-shot boots:

  • Without USB4_APPLE_SOC:
    • every tps6598x binds (M1 Pro 4/4, M2 3/3) and devices_deferred is empty;
    • each port logs "router unavailable, continuing without it" at about 15 s;
    • the charger partner is present, AC online, PD source online.
  • With USB4_APPLE_SOC=m: Asahi's router driver probes cleanly (M1 Pro 3 routers + 3 switches, M2 2 + 2), and the ports bind immediately without the fallback.
  • Both: pm_test ×3 passed with 0 DART faults; Wi-Fi, BT, NVMe, GPU and audio OK; M2 eDP OK.

MacBook Neo (J700):

  • both sn201202x bound, the rear dock partner present, devices_deferred empty, AC online;
  • the fallback path never ran;
  • the integration battery passed at boot and after 3/3 s2idle (external 1080p180, GPU, Wi-Fi, BT, Touch ID, camera, mic, thermal, 0 WARN).

KUnit passes, and checkpatch reports 0 errors.

🤖 Generated with Claude Code

On the M1 and M2 machines every CD321x Type-C connector is linked
through its port@2 endpoint to the USB4 router serving that port, and
cd321x_register_port() looks up the router's Thunderbolt switch with
fwnode_typec_thunderbolt_switch_get(). The lookup returns -EPROBE_DEFER
until the router driver (USB4_APPLE_SOC) has registered the switch.

So when that driver is not built, or the router fails to probe, every
linked PD controller stays deferred for good: no Type-C port, no
partners, no USB role switching and no DisplayPort alternate mode,
although the router only takes part in USB4 and Thunderbolt links.
Kernels configured for the M1 Pro and M2 from configurations that
predate the router driver show exactly that: only the connector-less
MagSafe controller binds, and the others stay in devices_deferred with
no recorded reason.

Handle the switch like other providers that may never get a driver:
keep deferring while the driver core still waits for missing
dependencies, and once driver_deferred_probe_check_state() gives up,
register the port without a switch, as for a connector with no router
link. Ports whose router registers its switch in time behave as before.

Fixes: fc76d0f ("usb: typec: tipd: Hook up tbt switch for Apple platforms")
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Test cd321x_tbt_switch_get() on a software node graph shaped like the
M1 and M2 device trees: a connector whose port@2 is linked to a node
with the thunderbolt-switch property.

A connector without that link, and a router that has registered its
switch, must not consult the driver core. A router that has not
registered its switch must defer the port while the driver core keeps
waiting, and must no longer hold the port back once it gives up.

Move the driver core query into cd321x_tbt_switch_keep_waiting() so
that the tests can redirect it with a static stub. Without KUnit both
helpers stay static and the stub compiles away.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide merged commit a6cfa4d into aurora-wip Oct 16, 2026
RyanTheTide added a commit to aurora-silicon/omarchy-pkgs that referenced this pull request Oct 16, 2026
Moves the pin from 99b5f912 to a6cfa4dd59a5, which is 99b5f912 plus merged
aurora-silicon/linux#327 (tipd: don't leave M1/M2 Type-C ports deferred
when the USB4 router never binds). The package config has CONFIG_USB4 off,
so without it M1/M2 users would get no Type-C ports. pkgver stays
7.1.12.aurora6 while the bump PR is unmerged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@DjDeveloperr
DjDeveloperr deleted the fix/m1m2-typec-usb4-router branch October 16, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant