Repository navigation
t8140: rearm the debug link reliably after a sleep - #1285
Closed
DjDeveloperr wants to merge 8 commits into
Closed
DjDeveloperr wants to merge 8 commits into
DjDeveloperr wants to merge 8 commits into
Conversation
The sleep controller ends the debug port's link with a cold reset of its port controller, and tipd rearms it in .complete with the boot loader's sequence. On the J700 a rearm can be refused: the controller rejects one of the commands. The sequence then stopped, so the controller stayed in its "DBMa" debug mode, unlocked, and the Debug USB didn't come back for the rest of the boot. Wait for the mode register after entering debug mode, as the boot loader does, before enabling the debug VDM. Leave debug mode and lock again after a failed step too. Repeat a failed rearm every 250 ms for up to 10 s from a delayed work, and keep it pending across a sleep that comes first, since a link that is down isn't cut again. Signed-off-by: Diljit Singh <hey@djdev.me>
The debug link is cut before a sleep with a cold reset of its port controller. The partner takes that as an unplug, attaches again and renegotiates its power contract. On the J700 that failed in about one sleep in 25: the controller saw nothing attached while the partner kept no contract, tipd's rearm was refused, and no VDM from the partner got through until the cable was replugged. After the reset, poll the controller's power status for a PD contract, for up to 5 s, and log how long it took. If none comes, reset it again, up to three times, then go on as before. Signed-off-by: Diljit Singh <hey@djdev.me>
Keep the tipd rearm and the partner wait after the cut; take the stack below, with #1304 and its EDAC merge, as is.
cd321x_init_work() now also sets up rearm_work, so the probe fixtures' cd321x needs the member, as it has update_work and resume_work. Without it typec-probe and probe-mux-pm-dispatch no longer compile. Signed-off-by: Diljit Singh <hey@djdev.me>
This was referenced Nov 9, 2026
Brings in #1208's aop-bootargs host test fix. No conflicts. Signed-off-by: Diljit Singh <hey@djdev.me>
Signed-off-by: Diljit Singh <hey@djdev.me>
Contributor
Author
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.
After a Linux sleep, the host's debug-USB reboot VDM sometimes got no answer from the MacBook Neo (J700), and the host's PD controller stayed busy on it until the cable was replugged.
Cause. Before each sleep, t8140-sleep cuts the debug link with a cold reset of the debug port's controller (sn201202x 1-0c). tipd then rearms it on resume. Two things went wrong:
-EPERM). The sequence stopped right there, leaving the controller in its "DBMa" debug mode, unlocked (its mode register readDBMainstead ofAPP). The Debug USB stayed down, and the reboot VDM went unanswered for the rest of the boot.Fix.
Hardware (J700). Stock DTB, production command line, SEP active. Each sleep was RTC-woken; the first of a boot is deep, the rest keep DRAM.
APPmode, and a later try rearmed the link.APP-mode controller.Not yet shown on hardware. The second reset in t8140-sleep hasn't met a real no-contract cut yet (none occurred in 35 cuts with it), so whether it brings the partner back is still open. The sn201202x rejects
DISC(-EINVAL), so a simulated unplug from the Neo's side isn't an option. Separately, on the merged test kit only, from its 13th sleep on the cut's first SPMI commands timed out (the stop failed: -110). The link then stayed up through those sleeps, and they still returned. This wasn't seen in 20 sleeps on the PR's tree alone.🤖 Generated with Claude Code