Skip to content

usb: typec: tipd, dwc3: apple: J714s: replug a DP alt mode hub whose SuperSpeed side didn't come back - #2274

Merged
DjDeveloperr merged 3 commits into
integration/aurorafrom
djdev/m5-j714s-dell-replug
Nov 20, 2026
Merged

DjDeveloperr merged 3 commits into
integration/aurorafrom
djdev/m5-j714s-dell-replug

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

On the J714s (M5 Pro), a Dell S2725QC on a Type-C port loses its USB3 hub's SuperSpeed side after many deep sleeps. The display runs in DP alt mode on two lanes and the hub on the other two: 0bda:5409 on USB2, 0bda:0409 on SuperSpeed.

  • The root port waits in Rx.Detect with a reset that never finishes (PORTSC 0x0a0002b0).
  • No host-side reset brings it back (8 of 8 lost wakes): USB2 reset, warm reset, root-port power cycle, PIPE reset, rebuilt xHCI.
  • A replug of the port does bring it back.

Three commits, on integration/aurora 449c6a1:

  1. usb: dwc3: apple: J714s: log a Type-C hub's missing SuperSpeed side after a sleep. Once, 5 s after the start that follows a sleep in which a SuperSpeed device was on a Type-C host port, it logs PORTSC and the LTSSM if only the USB2 side is back. This was a TEST commit, in the M5's default kernel since 11-16. Its code is unchanged; only the "TEST:" subject prefix is gone.
  2. usb: typec: tipd, dwc3: apple: J714s: replug a DP alt mode hub whose SuperSpeed side didn't come back.
    • tipd exports tipd_port_replug(): the port's controller detaches and reattaches the partner (DISC).
    • The SN201202x takes DISC only unlocked with the board key, as this file's J575c/J716c inherited-connection reset already does.
    • It runs on the port's work on the freezable workqueue, with the port lock held only for the commands.
    • Reads are 5 ms apart, the sleep's own SSPS gap; without it a relock ended in SPMI parity faults.
    • A failed relock is retried once. Other controllers get -EOPNOTSUPP.
    • dwc3-apple's check requests the replug through symbol_get().
  3. selftests: apple-dcp: follow the J714s port replug in tipd and dwc3-apple.

Hardware. This code has been in the M5's default kernel since 2026-11-19 15:50 (7.3.0-m5-intg26).

  • Every lost hub came back: 4 of 4, 4 of 4 and 2 of 2 in three runs.
  • No SPMI fault.
  • The Dell display blinks for about 6 s during a replug.

The rebased composition (integration/aurora + #2077 + #2231 + this) is being gated on the M5 as 7.3.0-m5-intg28. Results follow here.

Not in this PR:

  • The same loss at about 15% of boots. A boot-time replug (two commits, preserved on djdev/m5-j714s-dell-boot-replug) is held after an A/B showed more early alarm-type wakes; it will be its own PR.
  • Known issue: about 1 in 10 sleeps entered within a minute after a Type-C event on this port (this replug, or a cable event) hangs before the commit, and the watchdog resets the machine. It is being traced separately.

🤖 Generated with Claude Code

…fter a sleep

The Dell S2725QC on a J714s Type-C port (DP alt mode, PHY mode 3) has a USB3
hub, 0bda:5409 on USB2 and 0bda:0409 on SuperSpeed. After a deep sleep its
SuperSpeed side is missing in 12 of 41 wakes, while the USB2 hub always comes
back. The host's side of a bad wake logs the same as a good one: one start of
mode 3, no PIPE warning, xHCI, the USB2 hub. In good wakes the SuperSpeed hub
arrives 0.26 to 0.28 s after the USB2 hub enumerates.

Once, 5 s after the start that follows a sleep in which a SuperSpeed device was
on the port: if none is back while a USB2 device is, log both xHCI PORTSC
words and the core's LTSSM. They show which side gave up, the device or the
host's link, and so which macOS trace to take the fix from. Log only.

Signed-off-by: Diljit Singh <hey@djdev.me>
…SuperSpeed side didn't come back

The Dell S2725QC on the J714s's left-front port runs DisplayPort on two
lanes and its USB3 hub (0bda:0409, with the USB2 side 0bda:5409) on the
other two. After about one deep sleep in four its SuperSpeed side does
not come back: the root port waits in Rx.Detect with a reset that never
finishes (PORTSC 0x0a0002b0) and no receiver ever appears. No host-side
reset ends it: a USB2 reset of the hub, a warm reset or a power cycle of
the root port, a reset of the core's USB3 PIPE side and xHCI rebuilt
were each tried on real wakes (8 of 8 lost wakes stayed lost). A replug
does end it.

tipd: keep a list of the ports by the USB role switch they drive, and
export tipd_port_replug(), which has the port controller detach the
partner for a moment and attach it again (its "DISC" command): a new
contract, the alternate modes entered and the mux and the data role set
again, as a cable pulled and plugged back. The J714s's SN201202x takes
"DISC" only unlocked, with the board's key, as the inherited-connection
reset of the J575c and the J716c does: unlock, "DISC", wait for the app
mode, lock again. That runs on the port's own work on the freezable
workqueue, with the port lock held only for the commands, so the
interrupt handler sees the partner go and come back meanwhile and the
caller doesn't wait. The commands are read with the gap the sleep's
own system power state command is read with: read back to back while
the partner attached again, the relock ended late or in SPMI parity
faults and -EIO, and the next sleep hung. A relock that fails is tried
once more. Other controllers return -EOPNOTSUPP.

dwc3-apple: the start after a sleep already looked for such a device
once and only logged it (a TEST commit). When a SuperSpeed device was
on the port before the sleep and 5 s after the start only its USB2 side
is back, request a replug of the port, once, through symbol_get() so
that dwc3-apple gains no load dependency on tipd. The display on the
port goes dark for a few seconds; both of the hub's sides enumerate
again from the attach.

Signed-off-by: Diljit Singh <hey@djdev.me>
…pple

The tipd remove and probe fixtures run the actual tipd_remove() and
tipd_init(), which now take a port off and put it on the list that
tipd_port_replug() looks it up on. The dwc3 teardown fixture runs the
actual dwc3_usb_role_switch_set(), which now clears the J714s
SuperSpeed retry and schedules the check after a start. None of the
fixtures declared those, so 20 units failed to compile.

Stub tipd_port_list_add() and tipd_port_list_del(): the replug list and
its work are outside these fixtures. Give the dwc3 model the ss_retry
flag, never set there, and a dwc3_apple_check_hub_later() that asserts
it has nothing to schedule: a fixed hub's role switch returns before
it, and no fixture sets up a SuperSpeed retry.

Signed-off-by: Diljit Singh <hey@djdev.me>
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