Skip to content

selftests: apple-dcp: Follow the tipd lost-IRQ recovery helpers - #341

Merged
RyanTheTide merged 1 commit into
aurora-wipfrom
fix/apple-dcp-selftests-tipd-338
Oct 17, 2026
Merged

RyanTheTide merged 1 commit into
aurora-wipfrom
fix/apple-dcp-selftests-tipd-338

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

The tipd lost-IRQ fix (#338) left the apple-dcp host selftests at 50/55 on aurora-wip. Five units no longer compile on the host:

  • typec-probe, probe-mux-pm-dispatch, physical-disconnect, fast-replug-bounce and dropped-swap-teardown;
  • they inline cd321x-pm.h, which now includes <linux/minmax.h>;
  • the probe units don't extract the new cd321x_init_work().

This is one selftest-only commit:

  • One shared helper inlines the header, with a host clamp() in place of minmax.h.
  • The real cd321x_init_work() is extracted for both probe units.
  • typec-probe gains checks for usb: typec: tipd: keep a CD321x/SN201202x port from going deaf after s2idle (lost event IRQ) #338's behaviour:
    • a lost event reopens even a stale port with a full budget;
    • a failed acknowledgment keeps the budget, with backoff capped at CD321X_ACK_RETRY_MAX_MS;
    • sleep and removal leave lost events to the resume read.

Testing

Tree run.py
aurora-wip b659856e 50/55
b659856e + this commit 55/55
b659856e + #340 (USB/BT wake), without this commit 50/55, the same five failures
this commit + #340, which equals aurora-wip 2fa9722c + this commit 55/55
  • The 55 case names and their order are identical in all four runs.
  • -Wall -Werror and ASan/UBSan are unchanged.
  • The drivers/ tree is identical at base and head.
  • git diff --check is clean, and checkpatch --strict gives 0 errors.
  • Found by the backlog review t-2360. From now on, run.py runs on the merged tree as a merge gate for changes to tipd, atc, dwc3, drm/apple or AFK.

🤖 Generated with Claude Code

The host runner fails 5 of 55 cases since the tipd lost-IRQ recovery
because the typec-probe, probe-mux-pm-dispatch, physical-disconnect,
fast-replug-bounce and dropped-swap-teardown units no longer compile.
They inline cd321x-pm.h, which now includes <linux/minmax.h> for the
acknowledgment retry backoff, and the probe units do not extract the
new cd321x_init_work() called by cd321x_register_port().

Inline the header through one shared helper that provides a host
clamp() in place of minmax.h, and extract the actual cd321x_init_work()
for both probe units. Check in typec-probe that a lost event reopens even
a stale port with a full budget, that a failed acknowledgment keeps the
budget with a backoff capped at CD321X_ACK_RETRY_MAX_MS, and that sleep
and removal leave lost events to the resume read. The dispatch unit drops
these helpers like the other ones it does not exercise.

Retain the strict compiler and sanitizer settings and all 55 runner cases.
The full buildbox run improves from 50 pass / 5 fail to 55 pass / 0 fail.
No production driver changes are needed.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide merged commit 45647d0 into aurora-wip Oct 17, 2026
RyanTheTide added a commit that referenced this pull request Oct 17, 2026
Bring the 7.2.10 assembly to the tree of the canonical top-up #5
assembly 1c824ed, stacked on top-up #4 5043778 so that it is
a fast-forward of the published branch. The second parent is that
canonical assembly; the tree is identical to it.

Ported from aurora-wip, each with cherry-pick -x and its original
author:
- #338 tipd lost IRQ (5): never leave CD321x interrupt events
  unacknowledged, recover from a failed partner identity read, keep
  SN201202x events unhandled while it sleeps and wake it when suspend
  fails, and the KUnit race fix of the IRQ test (170-usb).
- #339 Touch ID verify retry (2): say why the sensor status after
  registration was unusable, and retry a failed sensor bring-up before
  a verify (100-sep).
- #340 USB and Bluetooth wake v4.1 (30): AIC wake (010-soc); xHCI,
  DWC3 and hub suspend-to-idle wake with their KUnit tests (170-usb);
  MT7932 Bluetooth wake and MSI wake for Apple PCIe (080-radio); the
  apple-dcp DWC3 wake model (200-dcp); the tools/aurora-wake regression
  tools (900-config-tooling).
- #341 apple-dcp selftests for the tipd lost-IRQ helpers (200-dcp).
- batch1 backlog: rust-clippy (4; 070-audio, 210-gpu), boot-warnings
  (3; 200-dcp), and the 4 harden-all commits not yet carried (010-soc
  qspi resume, 070-audio AOP wrapped-entry test, 200-dcp start
  completion). kunit-parsers, spi-apple-cs and the other 34 harden-all
  commits were already in the topics, including the AOP ring fix that
  top-up #4 brought; it is not duplicated.

Not ported: 3132675, superseded on 7.2.10 by b69728b
("selftests: apple-dcp: Follow the 7.2.10 driver boundaries").

Adaptations, each with a [ryan: ...] note in its commit:
- the new tipd KUnit tests take the CD321x and SN201202x data from
  the exported tipd_hw_variants[] table of 7.2.10;
- the #341 lifecycle.py import also keeps ATC_POST_TUNABLE;
- drm/asahi statistics style without the driver.rs part, which 7.2.10
  already has;
- the Rust doc example refresh only for KVec and Drain: iosys_map.rs,
  the old IoMem example and declare_flags_type!() are gone in 7.2.10;
- "Do not arm the core interrupt for wakeup" split between 170-usb and
  200-dcp.

New: 11e0ce6 ("usb: typec: tipd: cd321x: Don't race the resume
read in the sleep retry test").

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide deleted the fix/apple-dcp-selftests-tipd-338 branch October 17, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant