Repository navigation
usb: typec: tipd: J575c: renegotiate every inherited connection - #2875
Open
7robertodantas wants to merge 1 commit into
Open
7robertodantas wants to merge 1 commit into
7robertodantas wants to merge 1 commit into
Conversation
Since commit 1a774ee ("usb: typec: tipd: renegotiate inherited J575c connections"), a J575c connection inherited from the boot chain has been renegotiated only when byte 7 of register 0x7e lacked bit 3. That bit was taken to mean "the controller has completed an attach with the OS running", and bit 2 to mean the inherited state. It does not mean that. Read at the very start of the probe, before any command, byte 7 is 0x08 on every connected port, including a boot-attached USB 3 drive whose SuperSpeed side is stuck in RxDetect. The 0x04 that the gate saw came from the probe itself: it used to send each port an LDCM command before the gate. That command starts a new liquid measurement, and afterwards the controller reports 0x04. Since commit 5b5032b ("usb: typec: tipd: sn201202x: Send no LDCM command to a dry port") a dry port gets no LDCM command. The gate now sees 0x08 and skips the renegotiation. A USB 3 device attached at boot then comes up at 480 Mb/s (usb-storage instead of uas) until it is replugged. The controller reports nothing else that tells an inherited connection whose SuperSpeed side is stuck from one that trains. Drop the gate and renegotiate every inherited J575c connection. That is what the probe did before the LDCM change: in every J575c boot log we have from before it, the gate let every connected port through. Tested on a J575c (Mac Studio, M4 Max) with a USB 3 drive (10 Gb/s) attached through each reboot on the same port, kernel built from integration/aurora f5fae3c, whose tipd sources match this base: tipd sources byte 7 at the gate drive at boot f5fae3c 0x08, skipped 480M usb-storage same, LDCM change reverted 0x04, renegotiated Gen 2x1 uas f5fae3c + this change no gate, renegotiated Gen 2x1 uas With the tipd sources from before the LDCM change on the same kernel, byte 7 is 0x08 at the start of the probe and 0x04 at the gate. Fixes: 1a774ee ("usb: typec: tipd: renegotiate inherited J575c connections") Signed-off-by: Roberto Dantas <7robertodantas@gmail.com>
Contributor
|
Review at 17fa095. Thanks, the analysis of where the 0x04 came from is convincing, and dropping a heuristic on an undocumented status bit is the right direction. The change itself looks correct: J716c never set
Rows: the J575c rows cover the drive, HDMI, the DP monitor on typec1 and the hub. For no-regression it would help to have one J575c boot with a powered dock (with devices behind it) on a renegotiated port, and one with the boot or root disk on USB-C if that is a supported setup. Nothing else is affected: only the J575c and J716c DTs set the property, and the J716c path does not change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On current integration, a USB 3 device that is attached when a J575c (Mac Studio, M4 Max) boots comes up at USB2 (480M,
usb-storage) instead of 10 Gb/s (uas), until it is replugged. Stock linux-aurora -40 (9125b31) does not have the
problem.
Cause: the 0x7e gate that #1671 added (1a774ee) never really detected an inherited connection. The controller
reports byte 7 = 0x08 for any completed attach, including the one inherited from the boot chain. The 0x04 the gate
relied on was produced by the LDCM command the probe used to send before the gate. 5b5032b (no LDCM to a dry port,
as macOS) removed that command, so the gate now sees 0x08 and skips the renegotiation. 5b5032b itself is fine.
This PR drops the gate, so the J575c renegotiates every inherited connection, as it did before 5b5032b.
Change:
drivers/usb/typec/tipd/core.conly (-30/+4): removecheck_attach_state, theCD321X_ATTACH_STATE_*definesand
cd321x_attach_state_done(); update the board table comment. No DT or binding change. The J716c row is unchanged.Tests (J575c, USB 3 drive on typec3 attached through every reboot)
Kernel
7.3.0-1-106= integration/aurora f5fae3c (tipd sources identical to this base, 110861f), package config.With this PR: HDMI and the typec1 DP monitor connected, USB-A keyboard and the USB2 hub on typec OK (the hub's
keyboard needed one descriptor retry, -71, after the renegotiation; same with 5b5032b reverted), no failed units.
With the integration DT (
apple,event-irq-in-sleep), the port controllers still sleep while idle after therenegotiation: typec0, typec2 and typec3 (with the drive) suspended, typec1 (DP monitor) active, as without this PR.
Not tested: a J716c (its row has no gate and is unchanged).
cc @DjDeveloperr (5b5032b)
Assisted-by: LLM (Claude:Opus 5.5)