Skip to content

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

Open
techmore wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
techmore:m4/t8132-pmgr-policy-any-firmware
Open

techmore wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
techmore:m4/t8132-pmgr-policy-any-firmware

Conversation

@techmore

@techmore techmore commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

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.

Assisted-by: LLM

@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.

The platform handoff that applies the M4 PMGR ownership policy runs
only where apple_t8132_firmware_path() is true: the Airs, or OS
firmware 26.6.2. On any other firmware the T8132 power states are
registered as the SoC tree describes them and Linux switches domains
the firmware owns. A J773g on the macOS 27.2 stub resets two to four
seconds into every boot that way.

The policy describes the SoC's power manager, so select it by the
hardware it is written for: run the handoff on every T8132 tree. It
walks the apple,t8132-pmgr nodes and marks each power state with the
status and ownership of the embedded policy tree, whatever the OS
firmware. No version string is compared for it.

pmgr-pwrstate follows: with the handoff built, a T8132 power state it
did not mark fails with "missing M4 power-domain policy" on any
firmware, not only on the Airs and 26.6.2. That includes the case
where the handoff cannot resolve a live PMGR node in its policy tree
and drops the whole changeset: every T8132 power state that has no
status of its own in the tree then fails closed; a state the tree
marks itself (all of them on the complete J713 tree) is registered or
left out as the tree says. 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.

Within the handoff apple_t8132_air() and the policy tree's
apple,policy-machine entries stay: they choose between the legacy
J713 loader tree's rules and the others', not whether the policy runs.

Every T8132 Mac off 26.6.2 now gets the policy. Only the J773g has
been run there; no J604, J623 or J624 off 26.6.2 has.

Assisted-by: LLM
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
@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.

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