Skip to content

usb: typec: tipd: take the T8140/T8142 HPD rules from the port's DT - #3748

Open
RyanTheTide wants to merge 2 commits into
mainfrom
gates/tipd-hpd-synthesis
Open

RyanTheTide wants to merge 2 commits into
mainfrom
gates/tipd-hpd-synthesis

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

What: the T8140/T8142 HPD rules in tipd come from the port's DT, not the root machine compatible. The new boolean apple,no-hpd-synthesis replaces (1) !of_machine_is_compatible("apple,t8140") && !of_machine_is_compatible("apple,t8142") before the out-of-band connector reprobe after a USB4 route starts, and (2) tps->h17_display, which only tipd_resume() set, so it was false until the first sleep. It suppressed a made-up IRQ_HPD for a coalesced HPD pulse. The flag is now read once in tipd_init(). Every T8140/T8142 SN201202x with a DP route gets the property: J700 hpm0/hpm1, J704 hpm0/hpm1/hpm3, and J813/J815 hpm0/hpm1 (shared t8142-j813-usb.dtsi). The J815 MagSafe hpm5 has no DP route and is left out. Binding documented.

Tested: at 29870fd: make W=1 drivers/usb/typec/tipd/ builds with no new warnings; apple/t8140-j700.dtb, t8142-j704.dtb, t8142-j813.dtb and t8142-j815.dtb build with CHECK_DTBS=y and no warnings, and the property appears 2/3/2/2 times; dt_binding_check for apple,sn201202x.yaml is clean; apple-dcp host selftests 99/99 ok. No hardware row yet.

Risk: two-way door. T8140/T8142 only. One behaviour change: the IRQ_HPD suppression now holds from probe, not only after the first resume. That path runs only when DRM is not reachable, because the connector fwnode is always set on these ports, so in practice the behaviour is unchanged.

Not yet: a J700 (Neo) row. My module one-shot on the Neo failed in my tooling before this code ran, so it is still owed. T8142 boards (J704/J813/J815) are not ours; their rows should come from their owner. This relies on the DT being correct.

Detail
  • tps6598x.h: h17_display is renamed to no_hpd_synthesis.
  • The apple-dcp fixtures (lifecycle.py, transaction.py) gain the field, and the J700 fixture sets it.

Two CD321x display paths were gated on the root machine compatible:
cd321x_update_work() skipped the out-of-band reprobe of the display
connector after a USB4 route started on apple,t8140 and apple,t8142,
and cd321x_typec_update_mode() made up no IRQ_HPD for a coalesced HPD
pulse once tipd_resume() had set h17_display for the same two machines.
h17_display was only set at a resume, so before the first sleep it was
false on those machines too.

Describe the rule on the port instead: a port whose DT gives
apple,no-hpd-synthesis passes the display side only the HPD changes the
controller reports. The flag is read once in tipd_init(), so it holds
from the probe. Every T8140 and T8142 port with a DisplayPort route
(J700, J704, J813, J815) gets the property; the J815 MagSafe port has
no route and is left out.

Document the property in the SN201202x binding and model it in the
apple-dcp host fixtures that extract cd321x_update_work() and
tipd_init().

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide requested review from a team as code owners December 1, 2026 05:42

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 29870fd

Checked: binding, the J700/J704/J813-J815 DTS(I) nodes and core.c.

  • no_hpd_synthesis is read once in tipd_init() and replaces both the machine-wide t8140/t8142 check before the USB4 reprobe and h17_display.
  • h17_display had no other user (the field is gone and it builds).
  • Every T8140/T8142 port with a DP route gets the property.
    Follow-ups (not holds):
  • Deliberate behaviour change: h17_display was set only in tipd_resume(), so before the first sleep these ports synthesised IRQ_HPD for coalesced pulses. Now they never do, from boot. That is the intended rule, but a cold-boot hotplug row on J700 or J813/J815 is the one to watch.
  • The reprobe exclusion is now per port. Ports without the property on these machines (the J815 MagSafe hpm5) are now reprobed after a USB4 route starts where the machine check used to skip them. They have no DP route, so it should be a no-op.

@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) area:usb Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) blast:neo Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Merge readiness at b3c14ce1: not ready yet

Check Detail
CI at head ok 5 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok comment at b3c14ce1
Conflicts ok none
PR text ok Risk: two-way · . T8140/T8142 only. One behaviour change: the IRQHPD suppression now holds from probe, not only after the first resume. That path runs only when DRM is not reachable, because the connector fwnode is always set on these ports, so in practice the behaviour is unchanged.

Areas: area:bringup, area:usb

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch (bot) label Dec 1, 2026
DjDeveloperr
DjDeveloperr previously approved these changes Dec 2, 2026

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. The two machine checks become one port property, set on every T8140/T8142 port with a DP route. Ports without it (other SoCs, J815 hpm5) keep today's paths. The one real change, suppression from probe instead of after the first resume, only matters without a connector fwnode, which these ports always have.

Still to do: a merge-up (it conflicts with main), then the J700 row (external display hot plug, plus a USB4 device on the other port). Because tipd is shared, also one non-T814x SN201202x row. The T8142 boards' rows should come from their owners. I've queued the J700 and second-generation rows.

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Dec 2, 2026
- apple,sn201202x.yaml: main added apple,no-data-role-swap where this
  branch adds apple,no-hpd-synthesis. Keep both.
- tipd core.c: main now replays HPD low before a coalesced pulse;
  keep its comment and add this branch's apple,no-hpd-synthesis line.
  main also set h17_display from the machine compatibles at the top of
  tipd_init(). This branch replaces h17_display, so read
  apple,no-hpd-synthesis there instead, before anything can use it,
  and drop the later read.
- apple-dcp transaction.py: keep this branch's no_hpd_synthesis field.

Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Merged main into this branch as b3c14ce136af (a merge commit, no rebase or force push).

  • apple,sn201202x.yaml: main added apple,no-data-role-swap where this branch adds apple,no-hpd-synthesis. The merge keeps both.
  • tipd/core.c, the coalesced-pulse comment: main now replays HPD low before the pulse. The merge keeps main's text and adds this branch's apple,no-hpd-synthesis sentence. The condition itself merged cleanly as !tps->no_hpd_synthesis && ….
  • tipd/core.c, tipd_init(): main had started setting h17_display from the T8140/T8142 machine compatibles at the top of tipd_init(). That fixed the same "false until the first resume" problem this PR fixes. This branch removes h17_display, so the merge reads apple,no-hpd-synthesis at that same early spot and drops the later read. Nothing runs before the flag is set.
  • apple-dcp/transaction.py: the merge keeps this branch's no_hpd_synthesis fixture field.

Against main 1b95b711bbc2, the merge changes the same 8 files as before (+36/−12).

Local checks on the merge tree, arm64 + asahi config, LLVM=1:

  • W=1 build of drivers/usb/typec/tipd/: no new warnings. The one warning, in i2c.c, is in a file this PR doesn't touch.
  • t8140-j700, t8142-j704, t8142-j813 and t8142-j815 DTBs build clean with CHECK_DTBS=y, and the property appears 2/3/2/2 times.
  • dt_binding_check on apple,sn201202x.yaml is clean.
  • The apple-dcp host selftests (run.py, all groups) pass 101/101.

What's left:

  • One review of this merge from someone other than DjDeveloperr (the last pusher).
  • A J700 row at b3c14ce1: external display hot plug, plus a USB4 device on the other port.
  • One non-T814x SN201202x row, because tipd is shared.
  • T8142 (J704/J813/J815) rows from those machines' owners.

#3747 also changes tipd/core.c and the same binding. Whichever of the two lands second will need a small merge-up.

@github-actions github-actions Bot added needs-review No approving review from Core or Omarchy Mac yet (bot) and removed merge-conflict Conflicts with the base branch (bot) needs-hw-row No hardware row at the PR head (bot) labels Dec 2, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Independent review of merge b3c14ce136af, by a reviewing agent that didn't make the merge: no blocking findings.

  • The apple,no-hpd-synthesis read now sits where main set h17_display, after the display-gate deferral check. Nothing before it uses the field: its only other users are hpd_pulse and the USB4 reprobe check, so reading it earlier is strictly safe.
  • h17_display is gone from the code, headers, KUnit and the selftests.
  • The hpd_pulse hunk keeps main's replay-HPD-low comment and its new conditions.
  • The DT counts per board match the PR head, and the binding keeps both properties.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

J773g (M4 Mac mini, Mac16,10, T8132, os-fw 27.2 / 26B123) non-regression hardware row at exact head b3c14ce136af (composite 7.3.0-j773g-comp6b+ over b902937859ec, boot_id=131ad383-3d5c-4124-9697-1c0a7ada6291): PASS.

  • Type-C ports: port0 (data=[device], pwr=[source], partner 0x73213102), port1 (data=[device], pwr=[source], partner 0x731d3115), port2 (data=[host], pwr=[source], partner 0x0f010100) all enumerated cleanly.
  • DP-3 (3840x2160) software off->detect: 3/3 recovered to connected/enabled/On.
  • s2idle (rtcwake -d /dev/rtc1 -m freeze -s 5): post-sleep DP-3=connected/enabled/On, end0 UP, SYSTEMD_FAILED=0, 0 TIPD/DP/kernel WARNING/Oops/BUG lines.

@aurora-silicon-review
aurora-silicon-review Bot requested review from maralcbr and removed request for maralcbr December 3, 2026 04:32

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bringup Area from CODEOWNERS (bot) area:usb Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) blast:neo Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants