Skip to content

PCI: apple: mask Clock PM before enabling adopted T6050 endpoints - #1618

Open
satchlj wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
satchlj:j775c-clockpm-upstream-20261111
Open

satchlj wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
satchlj:j775c-clockpm-upstream-20261111

Conversation

@satchlj

@satchlj satchlj commented Nov 12, 2026

Copy link
Copy Markdown
Member

GPT-6.1 Sol on @satchlj's behalf

Mask PCIE_LINK_STATE_CLKPM before enabling endpoints on the adopted T6050 host, then walk the enumerated bus to retain that policy. Firmware owns CLKREQ# pads and reference-clock gating here; suppressing L0s/L1 capability bits alone does not mask Clock PM. This is the isolated sufficient boot fix, without the private bus-number, NVMe or suspend/PME changes.

Scope: only t6050_hw (apple,t6050-pcie) sets adopt_link. This covers native M5 Pro/Max/Ultra adopted hosts, including J714/J716 and J775 boards; the separate PCIe-C/tunnel match data and earlier SoCs do not select it. J714/J716 results are not known to us.

Hardware evidence from Satya's J775c Mac Studio M5 Max bisection (2026-11-11/12): plain integration 716670b987b23536eafea3b647ffa7f28ef762b7 did not return from boot with the retained candidate44 DT or the attempted ported layout. Bus-number preservation alone automatically returned to the default, not as the trial, and was insufficient; old NVMe alone also failed. Clock PM suppression alone at b88dec9637cf3e4ce56d7b146af907ef4d58ff5f, kernel build #6, returned as the trial with management Ethernet, Wi-Fi and root NVMe, using installed Aura b6e6faf4.

That kernel also passed the final incremental DT 9c038a05a1aaf2c2722ca1e354b24125011c0f7c, source DTB SHA256 bffee06f90270ddb50d933082bdff86f01447a979e470521d5209ea492b0bb84: CPUs0-17, 62GiB, root NVMe, wired/Wi-Fi, USB2/3 hubs and microphone, HDMI connected, USB audio plus two display audio cards, GL9755, four router DT statuses okay, TB20Gbps to alba in both directions and renderD128. SDDM/NetworkManager/sshd active, zero failed units after a userspace stable-sysfs-path service fix. This is enumeration/health evidence, not playback or device stress qualification.

Rebased onto freshly fetched integration de6a8d46f755237a012435a735251a5efb325d34. This exact rebased kernel has not been booted. Original author Satya Benson is retained, deriving from his candidate44 caf39be510c0c54ddce8b077021f05b890608683 Clock PM policy; DCO signoff and Assisted-by retained.

Offline: Clang18 arm64/16KiB drivers/pci/controller/pcie-apple.o builds on this exact head (AArch64 ELF verified); checkpatch0 errors/1 commit-prose warning; whitespace check passes. No DT or binding paths edited, so DT/binding checks are not applicable to this driver-only PR. Host details: repository full runner on this exact head completed 248/255 initially; all seven failures were absent historical-object/path controls. After fetching their Aurora fixture revisions, all affected controls passed on this exact head (bcm4377-id1/1, compute-preempt2/2, dma-heap-fd1/1, g15-input-error3/3, neo-auxiliary3/3, neo-stability10/10). This is a complete initial run plus targeted successful reruns, not a second monolithic255/255 run. VM tools are Python3.12.3/Rust1.93.1/Clang18.1.3, differing from hosted CI Python/Rust pins; no hosted-CI equivalence claim.

Not covered by this bisection: HDMI replug, audio playback (analog AOP card absent with integration), SD media/physical hotplug/discard, RTC wake or suspend qualification. Historical candidate44 tests are not attributed to this head. The Thunderbolt recovery driver series is separate: R3 booted but stop/start soak failed cycle3 after two passes, not25/25; freezer0/5. No other-board regression result is claimed.

🤖 Generated with Codex (GPT-6.1 Sol)

@RyanTheTide

Copy link
Copy Markdown
Contributor

@satchlj This conflicts with integration/aurora now, please rebase. Two notes on the code: apple_pcie_adopted_no_clkpm() does not need pcie->lock, so please call it before mutex_lock() in apple_pcie_enable_device(). And since this turns Clock PM off on every adopted T6050 link, we need a boot and s2idle result from a J714s and a J716c as well as your J775c on the rebased head before it can go in.

@satchlj

satchlj commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1 Sol on @satchlj's behalf

Merged fresh integration/aurora 6970a51ef8c3fac411fab8b9b242b85b8324b8ab into this branch with merge commit e52e386dc26174cafe3d14f3e8722671c1eba0c4 (parents bb464b0c13c22c1dcf82ad9edd92897639ac26b9 and integration above); fast-forward push only, with the fork branch fetched again before pushing.

Resolved the single PCIe overlap by retaining the complete upstream Neo helper block and then the complete Clock PM host-init wrapper, preserving both the pre-enable mask and post-enumeration walk; no relocation or semantic change was needed.

Native lobata checks: net diff against integration touches only pcie-apple.c; checkpatch 0 errors/0 warnings, whitespace clean, exact PR-head PCIe object builds as AArch64. Full native kernel build passed with existing warnings.

One-shot boot passed on J775c with #1619 0075a007a50701db8cb2ac8aab5f6910377ed414; combined boot commit 4da06bc2a1bdeb0eaac1119fbddd1f7f55d97f11, Image.gz SHA256 41ce78c0b1eb1444e3c4d9e32ed9f1e7db0e8b9b64bf9ff728e37e664e5a9348, ANE-wrapper DTB SHA256 0a4ec6fdb639e9eedb4e0736419ba2a847879b3fe2c1a10af54cdfaa74befa28, config SHA256 58c6362ff6b3183b8a93ba39882f953074cd75547efe9fb234be6929761d5162. Actual trial kernel 7.3.0-lobata-refresh1618+ #1, boot ID 94a317b6-b638-4bb5-9dd2-217eaf37c5ec, arm64.nomte retained. SSH returned; /dev/nvme0n1p7 root ext4 rw; PCIe Centauri Wi-Fi 0000:01:00.0 (106b:1900) and RTL8127 Ethernet 0000:03:00.0 (10ec:8127) bound with IPv4; wired gateway ping 3/3. Kernel logs show Clock PM off: the host does not handle CLKREQ# for 01:00.0, 02:00.0 and 03:00.0; no PCIe AER errors or SError in complete collected boot logs; zero failed units.

Default candidate44 #25 restored healthy, trial marker spent, all seven protected hashes unchanged (installed Stage2/default/fallback/support payloads), Stage1 untouched, build directories removed and lock released. No failing control repeated, suspend, poweroff or recovery power cycle. This is boot/enumeration health evidence on J775c, not suspend or other-board qualification. Fresh hosted host-tests queued at publication; no review requested.

@RyanTheTide

Copy link
Copy Markdown
Contributor

@satchlj thanks for the J775c boot result. Three things before this can go in. Please rebase onto integration/aurora instead of merging it in: the merge commit e52e386 carries a conflict resolution and has no Signed-off-by. Please also move apple_pcie_adopted_no_clkpm(pdev, false) above mutex_lock(&pcie->lock) in apple_pcie_enable_device(), since it does not need that lock. Clock PM now goes off on every adopted T6050 link, so we still need a boot, Wi-Fi/BT and s2idle result from a J714s and a J716c on the rebased head, and s2idle on the J775c.

Restore the adopted-host Clock PM policy from candidate44.
Integration boots J775c with this change alone; restoring bus-
number preservation alone does not return as a trial, and
restoring the NVMe driver alone does not return.

The host leaves CLKREQ# pads and reference-clock gating in
firmware state. Removing L0s/L1 capability bits does not mask
PCIE_LINK_STATE_CLKPM. Disable it before endpoint enable and walk
the enumerated bus to retain the policy.

Adapted from Satya Benson candidate44 PCIe adoption changes.
Tested on J775c with Aura b6e6faf4 and candidate44 DTB; other
boards untested.

Signed-off-by: Satya Benson <satya@benson.earth>
Assisted-by: LLM
@satchlj
satchlj force-pushed the j775c-clockpm-upstream-20261111 branch from e52e386 to ccdd14a Compare November 13, 2026 09:37
@satchlj

satchlj commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1 Sol on @satchlj's behalf

Recreated this PR as one original authored/signed-off commit on fresh integration/aurora fdef45b015d68afec852cfa7b68846fb2fc036f8: new PR head ccdd14ad5493ee3eb16c4b29c512b7728820b59e. No merge commit remains in the PR range. Satya Benson's original author, author date, Signed-off-by: Satya Benson <satya@benson.earth> and Assisted-by trailer are retained. The PCIe insertion overlap is resolved inside that commit, retaining the complete upstream Neo helper block followed by the Clock PM host-init wrapper. The requested apple_pcie_adopted_no_clkpm(pdev, false) move above mutex_lock(&pcie->lock) is folded into the same commit. Net driver diff: 44 insertions/1 deletion; whitespace clean; checkpatch --strict: 0 errors/0 warnings/0 checks. Exact PR-head PCIe object compiled natively to AArch64; full native build passed with inherited warnings.

J775c boot PASS with fresh #1619 0075a007a50701db8cb2ac8aab5f6910377ed414, local combined boot head 0f7ff13d2724b7af4eb31030eec9a78a83c91ab0. Final trial 7.3.0-lobata-review1618+ #1, boot ID c83769d7-a1b5-489a-b45e-fb70e342eda3, arm64.nomte retained. Image.gz SHA256 bcdc88b3bb257d1cde9abb97d28d839065aa3c33a88dde07e46c85dd93692019; DTB 0a4ec6fdb639e9eedb4e0736419ba2a847879b3fe2c1a10af54cdfaa74befa28; config 2d337764bac210311d9f7a5dd7af491ff07e96e6dd1ba0d6ae66abe7caf315f7.

SSH returned as the actual trial; NVMe root /dev/nvme0n1p7 ext4 rw and direct read passed. PCIe control/Wi-Fi/BT functions 01:00.0/.1/.2 and RTL8127 Ethernet 03:00.0 present, PCIe links up. end0 carrier 1, IPv4 10.1.10.128, gateway ping 3/3. wlan0 associated (iw link, 5765 MHz), IPv4 10.1.10.55. Bluetooth hci0 BC:89:C1:E2:E3:65 present and powered (btmgmt). PR mask logs on 01:00.0, 02:00.0, 03:00.0; lspci reports ClockPM- on affected links. Complete collected final kernel log has no AER/SError; SDDM/NetworkManager/sshd active and zero failed units.

Preliminary same-tree trials identified an inherited config with BT_HCICENTAURI disabled; enabling BT_HCICENTAURI=y gave a powered HCI. The first Wi-Fi scan command produced AP rows but timed out and was not repeated. Final Wi-Fi qualification uses successful association. Rewrapped inherited commit prose to satisfy full-commit checkpatch (0 errors/0 warnings), preserving author/date/signoff, then rebuilt the exact final PR object and combined kernel and booted the final head above. Earlier trial results are not substituted for this final boot.

s2idle: 0/5 attempted, none passed or failed. Cycles 1, 2, 3, 4 and 5 each NOT RUN: final trial offers [s2idle], but its only RTC is macsmc-rtc (/dev/rtc0), with no /sys/class/rtc/rtc0/wakealarm or device wakeup interface. Thus the required timed-wake preflight failed before any suspend/alarm was armed. The earlier candidate44 Abbey RTC-wake results do not apply to this DT/kernel. No unattended suspend without timed wake was attempted; J775c s2idle remains unqualified on this head.

Default candidate44 #25 restored healthy, marker spent, all seven protected Stage2/default/fallback42/support hashes unchanged, Stage1 untouched, ESP unmounted, build/bindgen directories removed and lock released. No poweroff, recovery power cycle, owner contact or other PR write. The owner branch was fetched fresh before the single force-with-lease update against expected e52e386dc26174cafe3d14f3e8722671c1eba0c4.

J714s and J716c boot, Wi-Fi/BT and s2idle rows on this rebased head are still needed from their owners. This J775c result does not replace those rows or qualify J775c suspend.

@satchlj

satchlj commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1 Sol on @satchlj's behalf

J775c (M5 Max Mac Studio): s2idle 0/5 completed. The single preliminary 20-second RTC probe did not return; cycles 1, 2, 3, 4 and 5 (30 seconds each) were all NOT RUN. This does not establish a #1618 regression: the wake prerequisite is test-only and the failure stage is unresolved.

Exact native test composition, fetched fresh from aurora-silicon/linux:

Native full build and SPMI register-layout host check passed. One-shot trial 7.3.0-lobata-s2idle1618+ #1 booted with arm64.nomte. Before sleep: direct NVMe read, Ethernet link/gateway ping 3/3, Wi-Fi scan, powered hci0 and SDDM/NetworkManager/sshd passed. ClockPM off on 00:00.0/00:01.0/00:02.0 and 01:00.0/02:00.0/03:00.0. rtc0 exposed wakealarm and enabled device wakeup.

Probe at 04:43:47 EST: rtcwake -m freeze -s 20 armed an alarm for 09:44:08 UTC, then did not return within three minutes. No resume receipt or post-sleep checks exist. After >5 minutes of SSH retries, failed ping and two Shelly readings, recovery cycle at 09:50:10 UTC did not restore networking. After another >5-minute retry window/readings/ping, a second recovery cycle at 09:55:34 UTC restored default44 #25. The persisted trial journal ends before suspend diagnostics; pstore is empty. RTC delivery failure versus suspend/resume hang cannot be distinguished.

Post-resume NVMe, Ethernet, Wi-Fi scanning, Bluetooth, PCIe/AER/IOMMU/SError, ClockPM preservation and display-manager checks are all unqualified. No usable timed wake was demonstrated. The J775c s2idle row will be done with the owner present on Friday 2026-11-13 afternoon US Eastern.

The gen4 SPMI driver prerequisite is still open (#1743), not merged into this integration. The compatibility RTC DT restoration belongs in #1619 paired with that prerequisite; DT-only on current integration is insufficient. Ethernet advertises WoL pumbg, currently disabled; not used, and PCIe-port power/PME retention through s2idle was not verified. No second probe attempted. A comparison without #1618 is unavailable because this kernel does not boot without the mask. Deeper-than-s2idle suspend and hands-on wake were not covered.

Handback: default44 #25 healthy (NVMe read, wired ping 3/3, Wi-Fi scan, powered Bluetooth, SDDM active, zero failed units); seven protected Stage2/default/fallback/support hashes unchanged. Stage1 untouched, marker spent, ESP unmounted, build/bindgen outputs removed, lock released. No pushes or other GitHub writes. Full report: work/UPSTREAM-1618-S2IDLE-20261113.md in the owner's m5-studio-prep workspace.

@satchlj

satchlj commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1 Sol on @satchlj's behalf

Follow-up localisation on J775c changes the earlier “RTC delivery versus suspend/resume unknown” boundary:

  • Default local candidate44 j416s: auto-recover the Thunderbolt DP tunnel and display after standby #25: awake 20s alarm fired (RTC IRQ151 0→1); one 20s RTC-woken s2idle probe returned, then 5/5 30s cycles returned, with settled NVMe/Ethernet/Wi-Fi/Bluetooth/services and specified kernel-error checks passing.
  • Exact same upstream test artifact as above (Image.gz SHA256 32409b31e64c6a0c4980b57ed865b9e53a33dde743199bd3951b2b3ffb4f60e7, DTB 33132b765abd9cf691a5b38c0328805df7ee5ce57e26e49e5b4d399252d020b4): awake alarm does fire, RTC IRQ147 0→1; enabled macsmc-rtc wake source recorded an event. This establishes awake delivery and registration, not suspended delivery.
  • With pm_print_times enabled and no_console_suspend + arm64.nomte: pm_test=freezer returned in6s; devices returned in8s. NVMe, wired ping, Wi-Fi scan, Bluetooth and services passed both. wifi: brcmfmac: pcie: keep Apple firmware in D0 across s2idle #1722 is in the integration ancestry. Devices was not fully clean: Thunderbolt carrier fell1→0; HDMI remained connected, but DCP logged updateFrequencies/pmu-read firmware errors. Every recorded Linux PM callback returned0; slowest was apple-drm resume1.503409s (r8169 resume0.495268s; slowest suspend USB1-1.4 at0.300292s).
  • pm_test=platform did not return. This test needs no alarm and returns before s2idle_loop. No real upstream sleep was repeated. The persisted journal stops just before the test; pstore empty. No last callback can be named. Platform adds late/noirq/platform-hook coverage, but an earlier devices pass does not prove the later invocation reached those additional stages. Processors/core are explicitly unsupported for s2idle in this source.

Thus local hardware plus loader can do RTC-woken s2idle today, and the upstream failure is reproducible without depending on alarm wake. Exact failing callback remains unresolved. #1618 is neither implicated nor exonerated; no bootable without-mask control or isolated DT/RTC cause exists. No speculative fix made. The sleep row still needs a clean platform test (plus TB/DCP investigation), then the gated real-sleep probe and five cycles.

Two prescribed Shelly recovery cycles were needed after >5-minute SSH retry windows/readings/pings. First recovery not restoring management does not identify the failure stage. Default44 #25 is healthy again; TB carrier1, protected Stage2/default/fallback hashes unchanged, lock released, ESP unmounted, no build outputs created. No pushes. Full evidence/report: work/UPSTREAM-S2IDLE-LOCALISE-20261113.md in m5-studio-prep.

@satchlj

satchlj commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1 Sol on @satchlj's behalf

J775c s2idle qualification update: no upstream s2idle row yet; 0/5 qualification cycles attempted. Two independent prerequisites are unrelated to masking Clock PM: the autonomous GPU-mailbox receive poller can fault when its domain is gated (local quiesce candidate prepared), and apple_pcie_check_adopted_s2idle() admits J716c/K114c but excludes J775c before inspecting endpoint state. These results neither implicate nor fully clear #1618 for sleep.

Read #1710/#1711 and their diffs as the K114c precedent. Live J775c DT confirms both GPU mailboxes share GFX at 2300e80000/power-controller@110. Tested natively, one-shot with arm64.nomte, on integration aa68b3c81830a0bfecb636697bc8014a1260c7f5 + #1618 ccdd14ad5493ee3eb16c4b29c512b7728820b59e + #1619 0075a007a50701db8cb2ac8aab5f6910377ed414 + the existing test-only RTC/SPMI additions (combined base f68ef249f4c55e7dbf1693f1e0fad1cf4b2ce885):

  • GFX sleep retention + J775c guard admission, no quiesce, head a841be857157df4babafd2c1832be83f36e91368, kernel 7.3.0-lobata-gfxretain+ #2: freezer rc0/5s, devices rc0/8s; platform returned rc1/-EBUSY after 3s, NOT a pass. Image SHA256 eda3a8418a87e2b5f397db7afd4139931b1ea8eadb1b3066fe87b4e466d46551; DTB b6d5192ae42c131a495293421d328e56cc4596df7c4f58abdd7cfc9df075a787.
  • Revised noirq quiesce + J775c admission, no GFX retention, head b10eebde8c98c10ddb2fb417675a92059628770a, kernel 7.3.0-lobata-qnoirq+ #3: freezer rc0/5s, devices rc0/8s; platform returned the same rc1/-EBUSY after 3s. Local quiesce-only commit 592af129d09722ed0c3edba6a48c034011958d8f revises 145f05cd63b752e9c7e8cd8842e4193e9e975a26: synchronously drain both fast hrtimer and delayed work in suspend_noirq, inhibit rearming, restart in resume_noirq. Image SHA256 5ee168f7c2ea2a3ff35f047d5831917f96fa74eea874d6a6cab50e267d4bfb60; DTB 33132b765abd9cf691a5b38c0328805df7ee5ce57e26e49e5b4d399252d020b4.

With the board-name gate opened, both configurations now reach the real endpoint-state guard: sdhci-pci 0000:02:00.0: adopted link requires accessible D0 devices for s2idle, then apple_pcie_suspend_noirq on 1cb0000000.pcie returns -16. This matches the GL9755/D3hot issue described in #1719; no D0-check relaxation was applied. Board admission alone is insufficient on J775c. The separate PMGR fab3-soc (280600000…power-controller@1e0) timeout recurred in both platform unwinds; its active child is atc0-common (PHY/USB/CIO branches).

NVMe direct reads, Ethernet carrier/ping, actual Wi-Fi scan, Bluetooth controller and display-manager/service checks passed after each return; post-return PCIe Clock PM readbacks were unchanged, links recovered, GPU remained bound, and no new mailbox error/SError/AER/IOMMU fault signature was found in these test windows. This is unwind health, not real-sleep or GPU-workload qualification. Processors/core are rejected for s2idle by this kernel; RTC probe and five cycles were not run because platform did not pass. Installed Mesa's upstream DRM-name mismatch remains unrelated and no Vulkan result is claimed.

No hang or recovery cycle in this task. Returned to healthy default44 #25, seven protected hashes verified, ESP unmounted, lock released and native build directories removed. No guard-admission commit is proposed upstream without successful cycles; patches remain local. Evidence: owner's work/UPSTREAM-S2IDLE-GUARD-20261113.md and accompanying receipts.

@satchlj

satchlj commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1 Sol on @satchlj's behalf

J775c follow-up: freshly fetched #1719 head 3b4fee8 does not yet yield a passing upstream s2idle configuration here. Composition: integration aa68b3c + #1618 ccdd14a + #1619 0075a00 + test-only RTC/SPMI, J775c adopted-link admission, ps_gfx apple,sleep-retained matching #1710, and the full #1719 diff. Exact composed head c361df8629e9d5f28bccc9b0109e7f88a87faf7a, native d3retain #1, helper-added arm64.nomte.

Freezer rc0/5s; devices rc0/8s. Direct NVMe read, Ethernet link/ping, Wi-Fi scan, Bluetooth, SDDM and GPU binding survived; Clock PM unchanged, no new AER/PCIe Bus Error/DART-IOMMU fault/SError in returned windows. Thunderbolt carrier0 after devices. Platform then hung without returning (07:38:10 EST); persisted journal ends at suspend entry, so neither D3hot acceptance nor the next callback is established.

Single distinct TEST-ONLY fab3-soc retention relaxation plus GL9755 acceptance logging, head3659d258e5429d349d2ff38b51b17648c3e2deac / d3fabretain #2, also passed freezer/devices and hung in platform (07:57:58). Audit log did not persist. Processors/core not reached (unsupported for s2idle in this source). No real sleep attempted: 0/5, all unattempted. Revised mailbox quiesce not run because retention did not qualify. These hangs do not attribute causality to Clock PM or #1719.

Default44 #25 control returned from 20s RTC s2idle rc0/22s, with no fab3-soc timeout; TB re-enumerated with carrier1. fab3-soc supplies ATC0 while the connected peer uses ATC1; a legitimate peer hold of this exact domain is unproven. Fabric retention did not produce a platform pass, so neither a harmless-warning claim nor a fix is established.

Two distinct hanging experiments, four recovery Shelly cycles (two per recovery after required retry intervals), zero intentional experiment power cycles. Final default44 #25 healthy; fallback42 #4/Stage2 and all seven protected hashes unchanged; ESP unmounted, lock free, builds removed. No qualified upstream admission commit or quiesce publication. Local report work/UPSTREAM-S2IDLE-D3HOT-20261113.md.

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.

2 participants