Skip to content

soc: apple: t8132: apply the PMGR policy on any firmware - #2317

Merged
RyanTheTide merged 3 commits into
aurora-silicon:mainfrom
techmore:m4/t8132-pmgr-policy-any-firmware
Nov 27, 2026
Merged

RyanTheTide merged 3 commits into
aurora-silicon:mainfrom
techmore:m4/t8132-pmgr-policy-any-firmware

Conversation

@techmore

@techmore techmore commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Tested

The current head is b1f53e2a, based on main at 645f7cd3.

The published predecessor and this head produced identical results on the same native and synthetic legacy J713 policy fixtures. Each completed 98,740 checks with zero mismatches, staged 160 properties on the legacy fixture and zero on the native fixture, and rejected the deliberately broken lookup. All 160 injected staging failures left the modeled tree unchanged. The inherited PMGR probe harness passed five groups. The mocked top-level handoff matched all 32 tested combinations of PMGR, PMP, GFX, firmware qualification and Air board selection.

Risk

An unmarked T8132 power state is rejected before register access when the platform handoff is configured. Without the adapter, main's existing protection for 26.6.2 and the Airs remains in effect. The policy also runs on a tree with a T8132 PMGR and no PMP provider. Where PMP is present, the merged #2533 memory handoff continues on newer firmware.

All three physical rows remain open for this head: a J773g on 27.2, a 26.6.2 regression with matched handoff counts, and a second T8132 model on non-26.6.2 firmware. Each needs default arguments, at least ten minutes of uptime, PMGR and unused-domain evidence, zero missing-policy messages, verified NVMe writing and the requested clean health checks.

Previous revision and hardware evidence

The earlier physical receipts are tied to their recorded SHA and fixture. On the previous published head, a J773g reached 601 seconds and completed a direct 64 MiB NVMe write. Its firewall service failed, kernel errors were present, and SELinux telemetry was unavailable. That run leaves the requested clean hardware row outstanding.

The previous head 63bb2424a combined #2588’s PMGR-node selection with #2317’s fail-closed guard on integration base 5746ef8a5. PMP/GFX memory compatibility nodes stay on the existing firmware-qualified path. The updated mapping harness passed 98,574 checks and the inherited-PMGR harness passed all five cases. Both changed ARM64 objects built with W=1 without warnings. The 26.6.2 and alternate T8132 newer-firmware rows remain open.

Earlier revisions and their hardware evidence

A J773g on the macOS 27.2 stub (26B123) resets two to four seconds into every boot: the platform handoff that applies the M4 PMGR ownership policy ran only on the Airs or on OS firmware 26.6.2, so elsewhere Linux registered and switched power states the firmware owns.

Change.

  • The handoff runs on every T8132 tree. No version string is compared for it.
  • pmgr-pwrstate.c: the fail-closed guard is keyed on the handoff being built (IS_ENABLED(CONFIG_APPLE_T8132_PLATFORM_HANDOFF)) instead of the firmware test, as asked in review. With the handoff built, a T8132 power state it did not mark fails with missing M4 power-domain policy on any firmware. With it not built, states are registered as the tree describes them.
  • The t8132.h comment and the Kconfig help say this.

Consequence of the guard, stated plainly. If the handoff cannot resolve a live apple,t8132-pmgr node in its embedded policy tree it drops the whole changeset, and then every T8132 power state that has no status of its own in the tree fails closed, on every firmware; a state the tree marks itself (all of them on the complete J713 tree) is registered or left out as the tree says. Before, that was the outcome on the Airs and 26.6.2 only; off 26.6.2 the states were registered unmarked. A machine that booted that way off 26.6.2 would now not register those domains. This is the behaviour the review asked for. A kernel built without the handoff used to fail closed on the Airs' loader tree and on 26.6.2; it now registers those states.

What "no board or version is compared" covers. Selection only. Inside the handoff apple_t8132_air() still chooses the legacy J713 loader tree's rule against the other trees', and the policy tree's apple,policy-machine = "apple,j713" entries keep nine J713-only states from other boards. Both are data about board wiring, unchanged.

Blast radius. Every T8132 Mac off 26.6.2 now gets the policy. Only the J773g has been run there.

Rows

J773g (Mac16,10, 16 GB, AQC113), macOS 27.2 stub (26B123), one boot each unless noted:

Head What ran Result
51d5a4b0 (first form: handoff everywhere and the guard on every T8132 state, the same guard semantics as this head with the handoff built) alone; and with #1898's commit, normal and plain command line supplied 0 platform nodes, 137 PMGR policy properties, keeps 1 of 2 power domains, no reset; plain line: clk: Disabling unused clocks, PM: genpd: Disabling unused power domains, SSH still answering at 120.8 s
71f69c89 = f80b351 (guard on the old firmware test) alone same handoff lines, no reset
624e09a6 (this head's tree) + #1898's commit for SSH plain command line one boot, up 684 s: supplied 0 platform nodes, 137 PMGR policy properties, keeps 1 of 2 power domains; 0 missing M4 power-domain policy lines; no reset; clk: Disabling unused clocks, PM: genpd: Disabling unused power domains; 64 MiB direct NVMe write at about 625 s; no WARNING/BUG/Oops, no NVMe error

Without the change every kernel resets on that stub.

Rows we cannot provide.

  1. Another T8132 Mac (J604, J623, J624, J713 or J715) on non-26.6.2 firmware: we have only the J773g.
  2. A boot on 26.6.2 with the guard change: our unit is on the 27.2 stub and has no 26.6.2 stub. DjDeveloperr's J773g is on 26.6.2 and could run it; the maintainers' lab Macs could cover both rows.

Host: apple-dcp suite 88/88 on this head (base 88/88). Builds with W=1 on the touched objects. checkpatch --strict: clean. Not run: dt_binding_check (no binding changes), KUnit.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-19T13:19:01.381887Z
We couldn’t complete this review. Comment @codex review to try again.
f80b351 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks. Applying the PMGR policy whatever the firmware is the right direction: the policy describes the SoC's power manager, not a firmware release.

One change. drivers/pmdomain/apple/pmgr-pwrstate.c:862 still has the fail-closed guard on the old firmware test:

if (t8132 && apple_t8132_firmware_path() && !of_property_present(node, "status"))

With this PR the policy is supplied on every firmware. A power state that it fails to mark should then also fail closed on every firmware, not only on the Airs and 26.6.2. Could you key the guard on the handoff being built instead, e.g. t8132 && IS_ENABLED(CONFIG_APPLE_T8132_PLATFORM_HANDOFF) && !of_property_present(node, "status")?

Rows: your J773g boots on the 27.2 stub cover that machine. Still needed:

  1. One other T8132 Mac (J604, J623, J624, J713 or J715) on non-26.6.2 firmware, without the bring-up parameters: up at least 10 minutes, the PMGR policy properties line, no reset, no missing M4 power-domain policy, unused domains disabled, an NVMe write.
  2. One boot on 26.6.2 with the guard change, with the same checks.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks, the amended commit keys the fail-closed guard on CONFIG_APPLE_T8132_PLATFORM_HANDOFF, which is what we asked for. The code side is done from our end.

The rows from before are still open: one other T8132 Mac (J604, J623, J624, J713 or J715) on non-26.6.2 firmware without the bring-up parameters (up 10 minutes or more, the PMGR policy properties line, no reset, no missing M4 power-domain policy, unused domains disabled, an NVMe write), and one boot on 26.6.2 with the same checks.

@RyanTheTide

Copy link
Copy Markdown
Contributor

This no longer merges into integration/aurora: 50d1488 dropped the machine check from the early return in t8132_platform_handoff(), so the line this PR edits is now if (!apple_t8132_firmware_path()). #2588 makes the same handoff change, keys the early return on the apple,t8132-pmgr node rather than the machine compatible, keeps the PMP/GFX memory nodes on the 26.6.2 path, and has a J773g 27.2 boot with the policy applied. This PR adds the pmgr-pwrstate fail-closed guard on CONFIG_APPLE_T8132_PLATFORM_HANDOFF, which #2588 does not have. Could you rebase onto #2588 (or fold the pmgr-pwrstate hunk into it) so one series carries the handoff change and the guard together, with the PMP/GFX question settled one way?

@techmore
techmore force-pushed the m4/t8132-pmgr-policy-any-firmware branch from 25b5b73 to 63bb242 Compare November 24, 2026 03:02

Copy link
Copy Markdown
Contributor Author

Rebased on 5746ef8a5 and pushed the combined series at 63bb2424a. It carries Diljit’s #2588 handoff change, then the fail-closed guard and the updated regression harness. The PMGR node selects the ownership policy on every firmware. The PMP/GFX memory compatibility nodes retain their existing firmware qualification. With the handoff built, an unmarked T8132 state fails before MMIO.

Both affected ARM64 objects compiled with W=1 without warnings. The policy mapping ran 98,574 checks with zero mismatches, and all five inherited-PMGR cases passed. The requested 26.6.2 boot and the non-J773g newer-firmware boot remain open. The earlier J773g trial at edf1a09f lost PCIe/Ethernet and rolled back at five minutes. It does not qualify this head.

Copy link
Copy Markdown
Contributor Author

Could a lab owner claim either remaining row for 63bb2424a: a non-J773g T8132 on newer firmware, or an M4 on 26.6.2? We have two J773g minis on newer firmware. For each row we need the default command line, at least ten minutes uptime, the PMGR policy count, unused-domain shutdown, no reset or missing-policy messages, and an NVMe write.

@github-actions github-actions Bot added area:platform Area from CODEOWNERS (bot) area:power Area from CODEOWNERS (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 24, 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.

Verdict: FINISH at 63bb2424a808

Blockers:

  • PR description (§4): Delete the trailing attribution line at the bottom of the PR body; commits, PR titles, and PR bodies must carry no tool or automation attribution.
  • Testing (§5): Post exact-head hardware rows built from 63bb2424a808 on the default kernel command line: (1) a passing J773g boot on macOS 27.2 firmware (the earlier J773g rows are pre-rebase and the edf1a09f trial rolled back after losing PCIe/Ethernet), (2) a 26.6.2 regression boot confirming the CONFIG_APPLE_T8132_PLATFORM_HANDOFF fail-closed guard and unchanged handoff counts, and (3) a non-J773g T8132 Mac (J604/J623/J624/J713/J715) row on non-26.6.2 firmware. Include uptime (≥10 min), PMGR policy count, unused-domain shutdown, 0 missing M4 power-domain policy, NVMe write, 0 SELinux denials, 0 failed units, and 0 new kernel errors.

Checked: Full diff (t8132-platform-handoff.c, pmgr-pwrstate.c, host harnesses), all 3 commits (human author/committer + DCO, #2588 commit carried verbatim), mergeability against main, and pre-PR checklist §§1–6. Code and PMGR fail-closed safety look solid; CI is 8/8 green at 63bb2424a808.

Evidence
  • Mergeability & branch: Fork PR (techmore/linux), MERGEABLE against main (5c2f6c56bbbc), no overlapping code changes since base 5746ef8a5.
  • CI at 63bb2424a808: 8/8 green — Host tests / host-tests, PMGR power state KUnit / kunit, and SEP source checks (source, rust-build, kunit, DWC3/ATC builtin-no-atc, DWC3/ATC modular-no-atc, DWC3/ATC builtin-modular-atc).
  • Checklist §§1–6:
    • §1–§3: t8132_platform_handoff() keys on apple,t8132-pmgr instead of firmware version, keeps PMP/GFX compatibility nodes on apple_t8132_firmware_path(), and safely runs of_changeset_apply() + t8132_framebuffer_domains() with pmp/gpu/gfx initialized to NULL. apple_pmgr_ps_probe() fails closed with -ENODEV before any MMIO when IS_ENABLED(CONFIG_APPLE_T8132_PLATFORM_HANDOFF) and status is absent. Default cmdline, no hardcoded safety limits.
    • §4: Commits 9d8a7ea6a556, fe7a68165086, and 63bb2424a808 have clean human author/committer and Signed-off-by lines (9d8a7ea6a556 carries #2588's 39478e3bdd1f verbatim); PR title is clean; PR body has a trailing attribution line to remove.
    • §5: Host test updates (m4-pmgr-policy and pmgr-inherited.py) cover the updated policy API and missing-status pre-MMIO -ENODEV path, but no exact-head hardware rows exist at 63bb2424a808.
    • §6: Naming clean in all touched lines, commit messages, PR title, and PR body.
  • Non-blocking nits:
    • drivers/pmdomain/apple/pmgr-pwrstate.c:25 (#include <linux/soc/apple/t8132.h>) and tools/testing/selftests/drivers/apple/pmgr-inherited.py:106 (apple_t8132_firmware_path) are now unused.
    • drivers/soc/apple/t8132-platform-handoff.c:8-9 and drivers/soc/apple/Kconfig:317-321 comments still describe the older firmware-qualified scope.
    • Coordinate closing #2588 as superseded once this PR is ready to merge.

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Merge readiness at b1f53e2a: ready to merge

Check Detail
CI at head ok 10 checks passed
Review ok approved by satchlj
Requested changes ok none
Hardware row at head ok comment at b1f53e2a
Conflicts ok none
PR text adopt when you next edit add 'one-way' or 'two-way' in Risk (guide)

Areas: area:platform, area:power
Merge: gh pr merge 2317 --merge (Owners and Core through the bypass: add --admin).

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

Copy link
Copy Markdown
Contributor Author

J773g (M4 Mac mini), macOS 27.2 firmware, exact head 63bb2424a80810ea945b751846315b69c708126a. The running kernel’s ELF notes matched the build. This was an isolated-root diagnostic boot with the lab PM overrides removed. The command line still selected the trial root and recovery timer, so the requested default-command-line row remains open.

At 601.69 seconds of uptime the boot journal showed 136 supplied PMGR policy properties, the same count as the installed control. It recorded unused-clock and unused-domain shutdown and zero missing M4 power-domain policy messages. Some providers later reported pending sync_state(). A 64 MiB direct NVMe write with fdatasync completed on this boot, and the file size was verified.

The health criteria remain open. One unit, firewall.service, failed. It also failed on the installed control. Both configurations omit the packet-type match required by that firewall rule. The candidate reported a PMP IOP power-acknowledgment timeout and probe failure (-62), a DCP missing-IOMMU-domain error, and wireless errors absent from the saved control error list. The control used a different kernel and command line, so this comparison cannot isolate their cause. The kernel build disables SELinux, and the boot journal contained zero matching AVC denials.

The 26.6.2 fail-closed regression and the non-J773g T8132 row on non-26.6.2 firmware are still pending.

@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch (bot) label Nov 24, 2026
Diljit Singh’s original aurora-silicon#2588 change selected the PMGR policy by the T8132 PMGR compatible. Implement its PMGR-only case alongside the merged PMP handoff, preserving current memory compatibility behavior on all firmware when the PMP provider exists.

Link: aurora-silicon#2588
Signed-off-by: Sean Dolbec <[email protected]>
With the platform handoff built, reject a T8132 power state that it did
not mark on every firmware. This matches the handoff now applying the
ownership policy whenever the T8132 PMGR block is present.

Extend the host harness to exercise the missing-status path and confirm
it fails before any MMIO.

Signed-off-by: Sean Dolbec <[email protected]>
Include the policy applicability helper, pass the legacy-tree argument,
and update the expected J713 power-state count. This restores the focused
PMGR mapping regression after the production policy gained
machine-specific entries and separate legacy behavior.

Signed-off-by: Sean Dolbec <[email protected]>
@techmore
techmore force-pushed the m4/t8132-pmgr-policy-any-firmware branch from 63bb242 to b1f53e2 Compare November 24, 2026 22:03
@techmore
techmore requested review from a team as code owners November 24, 2026 22:03
@github-actions github-actions Bot added the needs-hw-row No hardware row at the PR head (bot) label Nov 24, 2026
@github-actions github-actions Bot added blast:all Macs affected, from Merge risk (bot) and removed merge-conflict Conflicts with the base branch (bot) labels Nov 24, 2026

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Gemini 4 Neon on @satchlj's behalf

Verdict at b1f53e2acb84

APPROVE — Clean, well-scoped PMGR ownership policy fix for T8132 with fail-closed apple_pmgr_ps_probe() handling, updated host/KUnit matrix coverage, and 10/10 green CI.

Merge gate note: The 3 exact-head physical hardware rows at b1f53e2acb84 remain owed before merge (the earlier J773g diagnostic row was at 63bb2424a808).

Blockers

None in code or CI.

Checked

  • Full diff audit (5 files, +60/-25):
    • Extends the T8132 PMGR ownership policy to apply on any firmware and on device trees describing apple,t8132-pmgr without apple,t8132-pmp-v2.
    • apple_pmgr_ps_probe() fails closed when CONFIG_APPLE_T8132_PLATFORM_HANDOFF is enabled and status is absent, avoiding unintended power-state mutation without handoff status.
    • m4-pmgr-policy harness (domains == 145, t8132_policy_applies) and pmgr-inherited.py 2x2 matrix tests accurately exercise the updated policy gating.
  • Hosted CI at b1f53e2acb84: 10/10 checks successful (Host tests 6m45s, PMGR power state KUnit 5m4s, SEP source checks x5, pr-text, pr-readiness).
  • Untested scope: Static diff audit and CI verification only (no local kernel build or boot performed; exact-head physical rows remain owed by the author).
Evidence
  • Head: b1f53e2acb84 (OPEN|false|MERGEABLE)
  • Diff audited in full: 5 files (+60/-25)
  • CI: All checks were successful (10 successful, 0 skipped, 0 failing, 0 pending)

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Nov 25, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

b1f53e2 J713 (M4 Air, T8132, 27.2 fw, batched 0-diff merge onto main) PASS: booted default cmdline, 0 PMGR/power-domain errors (0 missing M4 power-domain policy), 3/3 rtc1 s2idle OK, Enforcing, 0 failed, 0 new kernel errors vs aurora/main control without #2317 on the same J713 (note: the 3 apple-dcp no-IOMMU-domain lines and dwc3-apple genpd_prepare -11 occur identically on plain aurora/main with J713 Stage 2 b15); fleet85 restored.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Status at b1f53e2acb84, against Dj's checklist from 11-24:

  • (3) Non-J773g T8132 on non-26.6.2 firmware: done. J713 (M4 Air, 27.2) on the default cmdline: 0 PMGR/power-domain errors, 0 missing M4 power-domain policy, 3/3 s2idle, Enforcing, 0 failed, 0 new kernel errors vs a same-Mac control.
  • (1) J773g on 27.2: still open. The 20:08 run is at 63bb2424, not this head. It ran on a diagnostic root and trial cmdline, and it reported a PMP power-ack timeout (-62) and a DCP missing-IOMMU-domain error. A default-cmdline J773g boot at b1f53e2acb84 with ≥10 min uptime is still needed, and its PMP/DCP errors need to be gone or shown to happen on the control too.
  • (2) A 26.6.2 regression boot (the handoff fail-closed guard, unchanged handoff counts): still open.

The PR body no longer carries the attribution line. This merges once (1) and (2) are posted.

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Nov 26, 2026
@RyanTheTide
RyanTheTide merged commit ad9455c into aurora-silicon:main Nov 27, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:platform Area from CODEOWNERS (bot) area:power Area from CODEOWNERS (bot) blast:all Macs affected, from Merge risk (bot) needs-template PR body lacks Tested or Risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants