Skip to content

PCI: apple: attach all internal-host power domains and retain them in s2idle - #1311

Merged
RyanTheTide merged 8 commits into
integration/aurorafrom
ctl/t-5958-pcie-apple-multi-power-domain-support-for-the-in
Nov 9, 2026
Merged

RyanTheTide merged 8 commits into
integration/aurorafrom
ctl/t-5958-pcie-apple-multi-power-domain-support-for-the-in

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Internal PCIe hosts leave their links running through suspend-to-idle and cannot retrain them after losing power. A host with several power-domains entries also needs explicit genpd attachment; the platform bus only attaches a single domain.

Attach every listed domain with PD_FLAG_DEV_LINK_ON, preallocate one notifier per domain, and veto power-off throughout internal-host s2idle. A failed hold unwinds earlier registrations and aborts suspend. The existing PCIe-C retention path uses the same helper. Single-domain hosts retain platform-bus attachment. CONFIG_PM=n keeps its no-op attachment behavior.

Describe both independent power chains for J616s and T8112. The T8140 change (APCIE_PHY_SW) is not part of this PR; it comes separately once it has run on hardware. The T6000 ADT audit shows its existing APCIE_GP_SYS chain is complete, so its DT is unchanged. Keep the interim J616s always-on states until internal-link cold resume is implemented.

Validation:

  • checkpatch and whitespace checks pass. Automatic host-tests pass.
  • A host harness runs the extracted attachment/hold/release/suspend functions with ASan and UBSan: attachment failures, single/three-domain holds, failure at every registration and off-domain position, six repeated cycles, managed-radio sleep admission, CONFIG_PM=n, and tunnel dispatch pass.
  • Controller buildbox shipping Image/modules and four board DTBs pass. A separate minimal Apple configuration asserts CONFIG_PM=n and PCIE_APPLE=y before compiling the driver; that compile passes. All 13 payload checksums, source hashes and four DTB hashes verify against the domain-closure audit.
  • The shipping build reports two seed-config normalization warnings and five missing MODULE_DESCRIPTION warnings in unchanged test modules; no diagnostic comes from the changed PCIe source.
  • M2 (J413), kernel = fleet44 + the two driver commits, DT = fleet44 J413 + this series' pcie0 power-domains: genpd shows the host attached to both apcie_gp and apcie_st (both on, device active). rtcwake s2idle (PMU RTC) x6: 6/6 entered and resumed, 0 failures, Wi-Fi reassociated in 5-9 s, Bluetooth powered, NVMe 2.1-2.3 GB/s direct reads, 3 PCIe functions present after every cycle, no PCIe/genpd warnings. FLEET regression suite (full, incl. 12 system-sleep cycles and 3 more rtcwake s2idle): same results as fleet44 (glmark -0.2%); the only kernel WARNs are the known tb_cfg_read: -107 from the Thunderbolt XDomain state work during suspend, unrelated to this host. 0 new AVCs.
  • J616s (T6041), kernel = 7.3.0 base + this driver, DT = the J616s DTB + pcie0 power-domains = <&ps_apcie_sys_gp>, <&ps_apcie_phy_sw>:
    • genpd shows the host attached to apcie_sys_gp and apcie_phy_sw (both on, device active).
    • All PCIe links at 5 GT/s x1 (BCM4388 Wi-Fi/BT, GL9755 SD); Wi-Fi associated, Bluetooth powered, NVMe 2.6 GB/s.
    • rtcwake s2idle (PMU RTC) x3: 3/3, 0 failures, Wi-Fi back in 2 s, 5 PCIe functions after every cycle, NVMe 2.5-3.3 GB/s after resume.
    • Quick regression suite: glmark -2.2%, 0 new AVCs. New lines are the ANE startup retry also seen on the stock kernel, and an AVD firmware load failure from the test package (it did not ship the AVD firmware).
  • M1 Pro (T6000, single-domain host, driver only): the platform-bus attachment is unchanged. Wi-Fi, Bluetooth and NVMe (3.6 GB/s) are fine, and the quick regression suite has no new error classes (glmark +3.7%).
  • After merging the current base, the only changes to the conflict sites are the T6050 adopted-link paths, which none of these hosts take. W=1 build is clean.

The binding now allows a second power domain (7f520fa2); dt-checks pass.

🤖 Generated with Claude Code

RyanTheTide and others added 8 commits November 9, 2026 21:14
Devices with multiple power-domains entries are not attached by the platform bus. Attach each domain with an active device link before touching the controller, while leaving the single-domain attachment to the bus.

Preallocate one notifier per attached domain and extend the PCIe-C sleep hold to cover all of them. Internal hosts leave their links running in suspend-to-idle and cannot recover from a power cycle, so veto power-off on every domain until resume. Unwind partial holds on error and abort suspend rather than lose an internal link.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The internal host needs both the general-purpose and storage/PHY chains listed by the ADT clock gates. On J616s APCIE_SYS_GP reaches APCIE_GP, while APCIE_PHY_SW reaches both storage chains and ANS. On T8112 APCIE_ST adds the ANS/storage chain that NVMe happens to keep powered today.

Keep the J616s interim always-on states until the host can cold-initialize its internal links after resume.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
…r chain

The T8140 ADT gates APCIE_GP, APCIE_SYS_GP, APCIE_ST, APCIE_SYS_ST, ANS and APCIE_PHY_SW for apcie0. APCIE_PHY_SW already has all of the other domains as ancestors, so attach the host to that leaf instead of APCIE_GP alone. This removes its dependency on NVMe keeping the storage and PHY chain on.

The host retains this chain during suspend-to-idle while the radio wake path leaves the internal link running.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The domain-attachment helper is a no-op without CONFIG_PM. Keep the host usable in that configuration instead of treating its zero return as a missing domain.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The internal PCIe controller on T6040 and T8112 needs two power domain
chains to stay on while its links are up. Allow up to two entries.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
# Conflicts:
#	drivers/pci/controller/pcie-apple.c
…ull power chain"

This reverts commit 5c96ab0. The Neo change has not been tested
on hardware yet; it comes back as its own change once it has.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
# Conflicts:
#	drivers/pci/controller/pcie-apple.c
@RyanTheTide
RyanTheTide marked this pull request as ready for review November 9, 2026 19:00
@RyanTheTide
RyanTheTide merged commit ac11649 into integration/aurora Nov 9, 2026
2 checks passed
DjDeveloperr added a commit that referenced this pull request Nov 9, 2026
Brings in #1311 (PCI: apple: multi power domain support). Conflicts in
drivers/pci/controller/pcie-apple.c:

- apple_pcie_attach_domains() and the Neo host's bootloader-replay and
  sleep functions both kept, each with its own return.
- apple_pcie_resume_noirq(): the domain hold is released first, then
  the armed Neo sleep returns to its own resume. The armed suspend
  returns before any hold is taken, so the release is a no-op there and
  the commit still powers the APCIe block down; s2idle and other hosts
  hold and release as in integration.

Signed-off-by: Diljit Singh <[email protected]>
DjDeveloperr added a commit that referenced this pull request Nov 9, 2026
Brings in integration/aurora ac11649 (#1311, PCIe multi power domain
support) through #1208. No conflicts.

Signed-off-by: Diljit Singh <[email protected]>
DjDeveloperr added a commit that referenced this pull request Nov 9, 2026
…omains

Brings in integration/aurora ac11649 (#1311, PCIe multi power domain
support) through #1208. No conflicts.

Signed-off-by: Diljit Singh <[email protected]>
DjDeveloperr added a commit that referenced this pull request Nov 9, 2026
…-edac-slpddr-wake

Brings in integration/aurora ac11649 (#1311, PCIe multi power domain
support) through #1208. No conflicts.

Signed-off-by: Diljit Singh <[email protected]>
DjDeveloperr added a commit that referenced this pull request Nov 9, 2026
…pcie-slpddr

Brings in integration/aurora ac11649 (#1311, PCIe multi power domain
support) through #1208. No conflicts.

Signed-off-by: Diljit Singh <[email protected]>
DjDeveloperr added a commit that referenced this pull request Nov 9, 2026
Brings in integration/aurora ac11649 (#1311, PCIe multi power domain
support) through #1208. No conflicts.

Signed-off-by: Diljit Singh <[email protected]>
DjDeveloperr added a commit that referenced this pull request Nov 9, 2026
…elect

Brings in integration/aurora ac11649 (#1311, PCIe multi power domain
support) through #1208. No conflicts.

Signed-off-by: Diljit Singh <[email protected]>
DjDeveloperr added a commit that referenced this pull request Nov 9, 2026
Brings in integration/aurora ac11649 (#1311, PCIe multi power domain
support) through #1208. No conflicts.

Signed-off-by: Diljit Singh <[email protected]>
DjDeveloperr added a commit that referenced this pull request Nov 9, 2026
Brings in integration/aurora ac11649 (#1311, PCIe multi power domain
support) through #1208. No conflicts.

Signed-off-by: Diljit Singh <[email protected]>
DjDeveloperr added a commit that referenced this pull request Nov 9, 2026
…neric

Brings in integration/aurora ac11649 (#1311, PCIe multi power domain
support) through #1208. No conflicts.

Signed-off-by: Diljit Singh <[email protected]>
DjDeveloperr added a commit that referenced this pull request Nov 9, 2026
…roc-crash

Brings in integration/aurora ac11649 (#1311, PCIe multi power domain
support) through #1208. No conflicts.

Signed-off-by: Diljit Singh <[email protected]>
DjDeveloperr added a commit that referenced this pull request Nov 9, 2026
…ug-cut-wakes

Brings in integration/aurora ac11649 (#1311, PCIe multi power domain
support) through #1208. No conflicts.

Signed-off-by: Diljit Singh <[email protected]>
@RyanTheTide
RyanTheTide deleted the ctl/t-5958-pcie-apple-multi-power-domain-support-for-the-in branch November 16, 2026 05:02
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