Repository navigation
t6041-j575c: SuperSpeed for USB3 devices attached at boot (renegotiate inherited Type-C connections) - #1671
Conversation
RyanTheTide
left a comment
There was a problem hiding this comment.
@7robertodantas the dt-checks failure comes from this PR: the new apple,reset-inherited-usb2-connection description is a plain YAML scalar with "does not recover: a USB2 repeater ..." in it, and the ": " makes the schema fail to parse (dt-checks then reports every sn201202x node as unmatched). Using a block scalar (description: |) fixes it. The tipd changes look good; we will run the asynchronous probe on our sn201202x Macs once the binding is fixed.
apple,reset-inherited-usb2-connection was written for the J716c, whose boot port keeps a USB2 repeater connection. The J575c needs the same renegotiation for another reason: a connection that is up when Linux starts keeps its Type-C retimer set up from before the host PHY ran, and SuperSpeed never trains. Describe both cases. Assisted-by: LLM (Claude Code) Signed-off-by: Roberto Dantas <7robertodantas@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the J575c (Mac Studio, M4 Max) a USB3 device that is attached while the Mac boots enumerates at USB2: its SuperSpeed port stays in RxDetect although the T6040 PHY tunes the right lane. Unplugging and plugging it again in the same orientation gives SuperSpeed Plus. The port controller reports the same status, data status and mode in both cases, and the same values macOS reports for that device at 10 Gb/s. Only byte 7 of register 0x7e differs: bit 2 on every connection Linux inherits from the boot chain, bit 3 after a replug and on every connected port under macOS, whose port controllers attach the devices again as macOS starts. Reuse the J716c renegotiation (unlock, DISC with a delay, lock) for the J575c, with its key, the reversed target identifier J575. Keep the board keys in a table. On the J575c only renegotiate a connection whose attach state lacks bit 3, and leave the port as it was if that fails, since it then only loses SuperSpeed. The J716c path is unchanged. Tested on a J575c with a USB 3.2 Gen 2 SSD attached across reboots on the fourth back port: SuperSpeed Plus Gen 2x1 and 926 MB/s without a replug (USB2 before); attach state 0x08 afterwards on every renegotiated port, as under macOS. The keyboard hub, a USB-C DP adapter (it hotplugs once) and the debug port keep working. Assisted-by: LLM (Claude Code) Signed-off-by: Roberto Dantas <7robertodantas@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Renegotiating an inherited connection waits about 5.6 s per port, and the controllers of one machine probed one after another, so with three ports in use the last one came up after 17 s. Prefer asynchronous probing; the driver keeps no shared state besides the debugfs root, which is already locked. On a J575c with three inherited connections all three are renegotiated within 2 ms of each other, 13.8 s after boot instead of 25.1 s. Assisted-by: LLM (Claude Code) Signed-off-by: Roberto Dantas <7robertodantas@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A USB3 device attached to a back Type-C port while the Mac boots stays at USB2 until it is replugged: the port's retimer (ADT i2c6 uatcrt0-3) was set up before the host PHY ran. Ask the port controllers of the second to fourth back ports to attach such a device again at probe. The first back port (hpm0) is left out: on the test machine it carries the DebugUSB cable, so a USB3 device there was not tested. The driver skips a port in debug mode either way. Assisted-by: LLM (Claude Code) Signed-off-by: Roberto Dantas <7robertodantas@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ff9c354 to
f148531
Compare
|
@RyanTheTide Thanks, fixed: the description is now a block scalar ( |
RyanTheTide
left a comment
There was a problem hiding this comment.
The binding parses now and dt-checks is green. The rest of the series is as reviewed. Because the asynchronous probe also applies to the sn201202x controllers on our M4 Pro and A18 Pro machines, it needs a few boots there before merge, to check port binding, the debug port, SuperSpeed enumeration and USB-C display before merging.
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed against current integration/aurora (I updated the branch so CI runs against it). The j575c DT edits don't overlap the recent HDMI, video-encoder or thermal changes, and the binding fix is right. The renegotiation is limited to the J716c and J575c by the new property plus the board table, and the J716c path is unchanged apart from its log line. The asynchronous probe looks safe for the other sn201202x machines. It has no shared state beyond the debugfs root, which already has a mutex. Deferral on the role switch still works, and suspend ordering follows device registration, so the registered-before-xHCI assumption holds. The one visible change is that /sys/class/typec/portN numbering may no longer follow DT order.
Optional follow-up: hold tps->lock across the renegotiation. The port is already registered, so a sysfs data/power-role change could otherwise send controller commands during the multi-second wait.
Approving. Following our current policy, the boots on the other sn201202x Macs that @RyanTheTide asked for will run after merge, with a revert ready.
The requested change (block-scalar description in apple,sn201202x.yaml) landed in f148531 and dt-checks is green, as RyanTheTide confirmed in his follow-up review. Under the maintainers' current policy, the remaining sn201202x boots run after merge, with a revert ready.
2129f55
into
aurora-silicon:integration/aurora
Written with an AI assistant (Claude) on @7robertodantas's behalf; every hardware step was run and checked on the owner's J575c.
t6041-j575c: SuperSpeed for USB3 devices attached at boot
On the J575c (Mac Studio, M4 Max), a USB3 device that is already attached when the Mac boots enumerates at USB2. The SuperSpeed port stays at
Link=RxDetect, although the T6040 PHY tunes the right lane and takes the PIPE. Replugging it in the same orientation gives SuperSpeed Plus. #1546 described this as orientation-dependent; it is not: on a fresh plug both orientations train Gen 2 (lane 0 and lane 1, same SSD and cable). Fixes #1670.Cause. The four back ports have Type-C retimers (ADT
i2c6/uatcrt0..3, Apple 0x05ac:0x2200). The AP does not configure them: macOS's only driver for them (AppleTypeCRetimer, 27.2.1 J575c kernel) reads the firmware version and NOR and collects crash logs, nothing about modes. The port controller (SN201202x) sets them up when a partner attaches. For a device attached before Linux, that happened long before the host PHY ran, and nothing redoes it.macOS does not have the problem: with the same SSD attached across a reboot it runs at 10 Gb/s, and its boot log shows each port controller come up fresh as macOS starts ("AppLoaded, reinit", then "No plug detected", then "USB2 USB3 as DFP connected" about 250 ms later), so the device is attached again while USB comes up (
Plug Event Count2,ConnectionCount1 on every port that had a partner).The port controller's status, data status (0x71000080, USB2 + USB3), mode and register 0x5d read the same on Linux in the failing state as on macOS. One byte differs, byte 7 of register 0x7e:
Change.
apple,reset-inherited-usb2-connectionalso covers this case (description only).DISCwith a delay, lock) gets a small board table. The J575c entry uses the key575J(the reversed target identifier, as617Jfor the J716c and as macvdmtool derives it), only renegotiates a connection without bit 3 in 0x7e byte 7, and leaves the port as it was if a step fails (it then only loses SuperSpeed) instead of failing the probe. The J716c path is unchanged.Tested on a J575c (linux-aurora 7.3.0, kernel 1943af8 with these driver changes as modules; DT = the live J575c tree plus only the property on hpm1-3, from a one-shot aura trial). Crucial X10 Pro (USB 3.2 Gen 2) on the fourth back port, a USB2 hub with the keyboard on the third, a USB-C DP adapter on the second, DebugUSB on the first:
RxDetect(3 of 3 boots)dt-validate(this tree's bindings)Not tested: a USB3 device on the first back port (hpm0); USB4/Thunderbolt partners; s2idle resume with the change (renegotiation only runs at probe); other SN201202x boards (only the J575c and J716c entries act, and only with the property).
Notes:
🤖 Generated with Claude Code