Repository navigation
usb: typec: tipd: the sleep's SSPS rules and the probe reset from the DT - #2640
Conversation
|
Reviewed f2c8080. The controller lists match the old board lists: the J714s and J716c have four port controllers each (hpm0/1/2/5 across the board and SoC dtsi files) and all four get Assisted-by: LLM (Claude:Opus 5.5) |
…ntroller
The macOS sleep entry and wake of an SN201202x, its USB-wake arm after
the PHYs' stop and the SSPS/USBw at a cable change were taken only on
the J714s (of_machine_is_compatible("apple,j714s")). Select them by
what the controller and its DT present instead:
- the sleep entry and wake: a polled controller (no interrupt in the
DT) that follows the system's power state (apple,sleep-ssps) and arms
no USB wake of its own (no apple,usb-remote-wake), for a firmware
sleep, from a port last known dry or mitigated, as before;
- the USB-wake arm: every controller with apple,sleep-ssps registers
for apple-sleep's notifier; it arms only with that macOS entry and a
connector with a partner, as before, and only the T6050 sleep's
.prepare_late calls the notifier;
- the cable change: an SN201202x whose DT asks for it with the new
apple,cable-change-ssps (set on the J714s's USB-C port controllers,
where macOS's sequence was traced), with a connector, while running,
and not one in a debug route (from before Linux, or opened through
debugfs). It is not
tied to apple,sleep-ssps: the J700's controllers follow the system's
power state, but macOS sends them only SSPS around a sleep.
On the J714s nothing changes, given a DTB built from this tree, except
that a USB-C controller in a debug route no longer gets the cable
sequence. The macOS entry now also applies to the other boards whose
DT marks polled SN201202x controllers with apple,sleep-ssps, J716c and
J813, and the USB-wake arm on the T6050 one (J716c). Neither has been
traced or tested with it.
Signed-off-by: Diljit Singh <hey@djdev.me>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A partner replug ("DISC") was offered only on the J714s, with the
J714s's unlock key built into the driver: "417J", the board number
reversed. The key is a board fact, the same kind of key the
controller's LOCK takes for its debug mode, which the DT already gives
as apple,debug-lock-key (J700: "007J").
Read the key from apple,debug-lock-key. tipd_replug_supported() is
true for an SN201202x whose DT gives a four-character key, and the
replug unlocks with it. The binding's description says the key is the
board number reversed, four characters, and serves both commands. The
J714s's three USB-C port controllers get "417J".
On the J714s the replug behaves as before, given a DTB built from this
tree; with an older DTB it is refused (-EOPNOTSUPP). The J700's debug
port controller already has its key, but its connector has no USB role
switch, so neither debugfs nor dwc3-apple can ask it for a replug. The
debug link rearm needs the key and a sleep that cut that controller's
link (apple,debug-port, the J700's only), so it doesn't start on the
J714s.
Signed-off-by: Diljit Singh <hey@djdev.me>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three board lists in tipd chose port-controller behaviour by machine: - tipd_sleep_ssps_rules() (J714s, J716c, J813, J815): the sleep's rules for the system power state command (woken first, its end read at intervals, a done read past the limit counts, a failed S3 refuses the sleep); - sn201202x_sleep_board() (J714s, J716c): a line at the probe and at the sleep's SLEEP; - sn201202x_j714s() in sn201202x_init() (J714s): a failed probe is reset and tried again. These are board facts, so they move to the controllers' DT nodes: apple,sleep-ssps-rules (the rules and the lines) on the J714s's, J716c's, J813's and J815's controllers, and apple,reset-on-failed-probe on the J714s's. The binding documents both. tipd_sleep_ssps_rules() and sn201202x_sleep_board() take the controller (tps, sn) and read the property; sn201202x_j714s() goes. The same boards get the same behaviour, given a DTB built from this tree, apart from the probe's and SLEEP's lines, which now also print on the J813 and J815. The J815 gets the property in its own DTS: it had the rules from the list without including the J813/J815 sleep dtsi. A J714s booted with an older DTB loses the rules, the probe reset, the cable sequence and the replug, so the DTB ships with the kernel. Signed-off-by: Diljit Singh <hey@djdev.me> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f2c8080 to
6465f0a
Compare
|
M5 (J714s) gate for this stack (#2638 + #2639 + #2640). Kernel 7.3.0-m5-sship3 = integration/aurora 5b596e6 + the three, built on the M5. DTB fdc15472 plus the new controller properties (c0440c9e). Test boot: clean.
Sleeps: 5 of 5 logind deep sleeps CLEAN, 30 s alarm: 4 entered 40 s after a debugfs replug of 1-0a (the Dell port), 1 plain.
In the first sleep's log, every step these PRs key on the DT ran with result 0:
Afterwards the M5 was restored and verified on its default. 🤖 Generated with Claude Code |
|
Merged as fd2587c, after Ryan's review, an independent re-check, green CI on 6465f0a and the J714s gate (5/5 on the stack). @erikwb and @m0d16l14n1: this changes code from your commits 302cc4e and f2bdd2e. The J716c/J813/J815 board lists became the per-controller 🤖 Generated with Claude Code |
Conflicts: tipd core.c/tps6598x.h (integration's #2640 SSPS rules from apple,sleep-ssps-rules replace this branch's apple,sleep-ssps commit 9fc5296, which is dropped; tipd_shutdown()/CMD1 idle wait kept), spmi.c (integration's DT-keyed probe/SLEEP lines and USBw kept; probe waits for CMD1 idle, cold reset only with apple,reset-on-failed-probe, otherwise deferred; the retry loop goes). Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Stacked on #2638 and #2639, whose commits this branch includes. Review only the last commit, the sleep's SSPS rules and the probe reset from the DT. Part of the no-board-gates rule: board facts go in the DT as properties on the controller nodes, and the per-board lists in tipd go away.
@erikwb and @m0d16l14n1: this changes code from your commits 302cc4e (J716c on the T6050 sleep rules) and f2bdd2e (the M5 Airs on the SSPS rules). Please review it.
What changes
tipd_sleep_ssps_rules(), the J714s/J716c/J813/J815 list, becomes a per-controller DT property,apple,sleep-ssps-rules. It sets the same behaviour as before: the controller is woken first, the command's end is read at intervals, a read past the limit that finds it done counts as done, and a failed S3 refuses the sleep.sn201202x_sleep_board()(J714s, J716c; log lines only) keys on the same property. The probe and SLEEP lines therefore now also print on the J813/J815. That is the only behaviour change.sn201202x_j714s()insn201202x_init()) becomesapple,reset-on-failed-probe.sn201202x_j714s()goes.Behaviour: unchanged on every board with a DTB built from this tree, apart from the extra log lines on the J813/J815.
Review: an independent review found nothing blocking. Fixed from it: the binding wording (the past-limit rule applies to every command; the probe retry's real shape), a blank line, a long comment, and the message.
Merge prerequisite (rig): the M5 rig's lab-built DTB (fdc15472) has none of these properties. Without them it would lose the SSPS rules (gapped reads, a wake before SSPS), the replug (#2639) and the cable step (#2638). So these three PRs merge together, after a rig DTB refresh (fdc15472 plus the new properties) has been gated and switched on the M5.
🤖 Generated with Claude Code