Skip to content

phy/thunderbolt: preserve PIPE ownership and separate shared NHI lifetime - #71

Merged
ooaklee merged 3 commits into
sp11/ubuntu-qcom-x1e-7.3.yfrom
x/sp11-v25-pipe-clock-20261016
Nov 10, 2026
Merged

ooaklee merged 3 commits into
sp11/ubuntu-qcom-x1e-7.3.yfrom
x/sp11-v25-pipe-clock-20261016

Conversation

@ooaklee

@ooaklee ooaklee commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Port the remaining QMP PIPE-clock and shared Thunderbolt NHI lifetime corrections onto sp11/ubuntu-qcom-x1e-7.3.y.

The upstream common PIPE-clock ownership move is already in 7.3, but the USB power-on timeout still dropped that common-owned reference. This port removes the extra drop. It also initializes shared NHI synchronization before interrupt registration, unwinds later initialization failures, waits for rejected ICM-domain release before fallback, and keeps PCI wake/runtime-PM policy in the PCI frontend.

The NHI adaptation preserves 7.3's host-reset state, shutdown DPR reset, PCI interrupt teardown, ICL power-off behavior and existing export boundary. It adds no Qualcomm host-router frontend, register map, device match, board activation or working Surface USB4 support.

Original head cdaa803a78b6827cf0346ab94227a4b9e81a483d is retained at archive/pr71-pre-7.3-20261110. The two original commits retain their authors/dates and messages with explicit port notes; a separate small style cleanup follows.

Validation at 9d6b3616d19c66f9bec6d9fa4155de2fc26e3510:

  • Fresh Linux ARM64 Kbuild with GCC 15.2.0, GNU ld 2.46 and W=1 compiled the complete QMP, NHI, PCI, ICM and TB translation units without warnings; all five outputs identify as AArch64 ELF.
  • Source-extracted host fixtures pass 45 behavioral cases: 29 NHI/PCI and 16 QMP. Ten exact-baseline negative controls detect the omitted behavior.
  • Both normal warnings-as-errors and AddressSanitizer/UndefinedBehaviourSanitizer runs pass. LeakSanitizer is unavailable on the macOS fixture host.
  • Independent source review found no blocking correctness issue; strict checkpatch (--no-signoff) and committed-range whitespace checks pass.

The fixtures use deterministic callbacks and stub kernel/MMIO/PCI dependencies; they do not prove real interrupt concurrency, physical DMA quiescence, or hardware operation. This is a source integration increment. Complete kernel/module/package validation with a new ABI and proportionate shared-device/recovery checks remain necessary before a new release or installation. It is not an upstream-qualified or operational USB4 claim.

The pipe clock is enabled in qmp_combo_com_init() and balanced in
qmp_combo_com_exit(). qmp_combo_usb_power_on() no longer acquires its own
reference, but still disables the clock when polling times out.

Return the polling error without releasing the common-owned clock. The
USB init error path already drops its common reference; the additional
disable can otherwise unbalance clock accounting or gate the clock of
an initialized DP consumer.

Keep successful initialization and register programming unchanged.

Fixes: f546912 ("phy: qcom: qmp-combo: Move pipe_clk on/off to common")

Port to the 7.3 default base 8ca6aef.
Original commit: 18417ab.
Initialize synchronization before interrupt registration and shut down
post-interrupt initialization failures without replacing the original
error. Leave wakeup and runtime-PM policy with the PCI frontend rather
than applying its reference-count assumptions to platform devices.

Skip the Intel firmware connection manager for non-PCI devices, and
guard the Apple PCI-link path before deriving its PCI container. Wait
for a rejected ICM domain to finish releasing before fallback, including
when debug kobject cleanup is delayed, then track the selected domain
with a fresh completion token.

Add a bus-neutral domain-removal helper with explicit caller
serialization and reference-lifetime requirements. Preserve the PCI
frontend's ordered PM calls and its managed interrupt-vector ownership;
destroy the empty ID allocator on interrupt-initialization failures.

Keep the shared helpers internal to the existing module. No experimental
Qualcomm frontend, register map, device match, build option or extra
symbol export is introduced by this change.

Adapt the shared-core portion of commit
2182ed736107cf1336022cb2579b31f18858fbeb to the accepted v25 carrier.
Omit its experimental Qualcomm frontend and five extra shared-helper
exports, retaining the carrier's existing module boundary.

This is a source-only shared-core foundation. It does not complete the
Qualcomm frontend's activation, IRQ/work teardown, power management or
hardware qualification.

Port to the 7.3 default base 8ca6aef.
Original commit: cdaa803.
Retain the newer 7.3 shutdown DPR reset path and host_reset assignment,
and the common init_interrupts diagnostic without a redundant PCI log.
Keep the existing internal module boundary and symbol exports.
@ooaklee ooaklee changed the title [TRACKING] QMP PIPE clock and shared NHI lifetime groundwork phy/thunderbolt: preserve PIPE ownership and separate shared NHI lifetime Nov 10, 2026
@ooaklee
ooaklee changed the base branch from x/sp11-sam-qualification-20261015 to sp11/ubuntu-qcom-x1e-7.3.y November 10, 2026 14:44
@ooaklee
ooaklee force-pushed the x/sp11-v25-pipe-clock-20261016 branch from cdaa803 to 9d6b361 Compare November 10, 2026 14:44
@ooaklee
ooaklee marked this pull request as ready for review November 10, 2026 14:46
@ooaklee
ooaklee merged commit c8cdaac into sp11/ubuntu-qcom-x1e-7.3.y Nov 10, 2026
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