Skip to content

soc: apple: t8132-platform-handoff: apply the PMGR policy on every firmware - #2588

Open
DjDeveloperr wants to merge 1 commit into
mainfrom
fix/t8132-pmgr-policy-every-firmware
Open

DjDeveloperr wants to merge 1 commit into
mainfrom
fix/t8132-pmgr-policy-every-firmware

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

What it fixes

On macOS 27.2 system firmware, Linux on the M4 Mac mini (J773g, T8132) takes an SError and panics about 1 s after the PCIe controller probes. That happens as soon as the GPIO providers it waits for (pinctrl-apple-gpio, gpio-macsmc) appear.

t8132_platform_handoff() returns early off the qualified firmware path (asahi,os-fw-version 26.6.2, or an Air). With that return it skips t8132_pmgr_policy(), so on 27.2 Linux owns every PMGR domain in the board tree, auto-PM included (pmgr-pwrstate writes APPLE_PMGR_AUTO_ENABLE at probe). That covers the domains 26.6.2 keeps firmware-owned (AIC, GPIO, display) or disabled for Linux.

This change applies the policy on every T8132 and keeps only the PMP/GFX memory compatibility nodes with the qualified firmware. The Airs already took this path on any firmware, so they are unchanged.

How it was found

One-shot proxy kboots of the installed m4drv8 kernel on the J773g with 27.2 (26B123), with no serial console. A panic left only its reset time (panic=30), so the bisect read that time:

  • Modules were loaded one at a time, 10 s apart (aurora.netstep=10 in a test initramfs). The crash moved with the step that releases pcie-apple: gpio-macsmc with port 0 enabled, pinctrl-apple-gpio with port 0 disabled.
  • With PCIe disabled in the DT, the same boot ran on to the NVMe root.
  • These were not enough on their own: pd_ignore_unused clk_ignore_unused, GPIO domains firmware-owned in the DT, and keeping the bus 0 scan off the empty port 1.

Hardware row: J773g, macOS 27.2 26B123

Tested with this change on the m4drv8 lineage. That kernel also carried an unrelated port-1 scan patch and inert debug markers, and had CONFIG_MODULE_ALLOW_BTF_MISMATCH=y so the installed modules would load. It ran from a one-shot aura proxy kboot, with the stock J773g DT and every PCIe port enabled:

[    0.028070] t8132-platform-handoff: supplied 0 platform nodes, 130 PMGR policy properties
[   30.468219] pcie-apple 1cb0000000.pcie: Link up on /soc/pcie@1cb0000000/pci@0,0
[   30.592915] pcie-apple 1cb0000000.pcie: Link up on /soc/pcie@1cb0000000/pci@2,0
[   50.262250] tg3 0000:02:00.0 eth0: Tigon3 [partno(BCM57762) rev 57766000] (PCI Express) MAC address ...
[   63.431120] tg3 0000:02:00.0 eth0: Link is up at 1000 Mbps, full duplex
[   64.059811]  nvme0n1: p1 p2 p3 p4 p5 p6 p7

systemctl is-system-running = running, 0 failed units, ssh over Ethernet. Without the change, the same boot reset about 31 s after kboot every time.

Not yet tested: this exact integration/aurora build, the J604 and the iMacs off 26.6.2, and 26.6.2 itself (where the code path is unchanged).

Not yet

  • M4 mini J773g and a compatible second T8132 board: boot the current head across supported stub firmware and verify the PMGR policy.

@RyanTheTide

Copy link
Copy Markdown
Contributor

The change is small and the early goto apply is safe, because pmp, gpu and gfx start out NULL for the of_node_put() calls at out:. Two points:

  • t8132-platform-handoff.c:322-329: the new comment says the PMGR policy describes the SoC rather than one firmware, but the embedded policy was qualified on 26.6.2. Off the qualified path, t8132_pmgr_policy() gives every pwrstate node without a policy entry status = "disabled" and marks ownership as 26.6.2 has it, so a domain that 27.2's firmware owns and 26.6.2's doesn't would still go to Linux. Is there an ADT or firmware comparison between 26.6.2 and 27.2 behind this? If not, could the comment state it as the assumption it is, so that a later 27.x crash points back here?
  • Testing: the J773g row comes from another kernel lineage with unrelated patches. A boot of this exact build on the J773g, plus a 26.6.2 machine to confirm that its handoff line (node and property counts) is unchanged, would close it. We can run the Air check on a J713: the handoff line and the domain states should match the base kernel.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Blockers: 2.

  1. The commit carries a Co-Authored-By trailer. Please drop it and keep the Signed-off-by.
  2. The new early return (t8132-platform-handoff.c:329) is of_machine_is_compatible("apple,t8132"). The pass works on the "apple,t8132-pmgr" nodes, which t8132_pmgr_policy() already looks up, so returning when no such node exists would key it on the block instead of the SoC.
    On the effect: on the J713 and J715 this is a no-op. apple_t8132_air() already made apple_t8132_firmware_path() true on any firmware, so they run the same statements before and after, as does every M4 on 26.6.2. Only the J604, J623, J624 and J773g off 26.6.2 change: they now get the PMGR policy and the framebuffer domain pruning.
    The comment at :322-328 says the policy describes the SoC rather than one firmware, but the policy was qualified on 26.6.2. A domain that 27.2 hands to firmware and 26.6.2 does not would still go to Linux. Please cite the 26.6.2/27.2 ADT comparison, or word it as an assumption.
    Missing rows: this exact build on the J773g with 27.2, and a 26.6.2 machine showing the handoff line unchanged.

…rmware

t8132_platform_handoff() returns early off the qualified firmware path
(macOS 26.6.2 for every M4 Mac but the Airs), and with it skips the PMGR
ownership policy. On the 27.2 firmware Linux then owns every power domain
in the board tree, with auto-PM written to each one at probe, including
the domains 26.6.2 keeps firmware-owned (AIC, GPIO, display) or out of
Linux's reach. On the M4 Mac mini (J773g) that ends in an SError as soon
as the PCIe controller probes, about 1 s after the GPIO providers it
waits for appear.

Apply the 26.6.2-qualified PMGR ownership policy whenever an
apple,t8132-pmgr node is present, under the assumption that it carries
over to newer firmware (noting that any domain newly claimed by firmware
on 27.2 would otherwise remain owned by Linux). Keep only the PMP/GFX
memory compatibility nodes gated on the qualified firmware path. The
Airs, which already took this path on any firmware, are unchanged.

Signed-off-by: Diljit Singh <[email protected]>
@DjDeveloperr
DjDeveloperr force-pushed the fix/t8132-pmgr-policy-every-firmware branch from ca92247 to 39478e3 Compare November 21, 2026 22:23
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Addressed the host-side blockers (head 39478e3bd):

  1. Dropped the Co-Authored-By trailer (single Signed-off-by: Diljit Singh <[email protected]>) and updated the PR body footer.
  2. Replaced of_machine_is_compatible("apple,t8132") in drivers/soc/apple/t8132-platform-handoff.c with an of_find_compatible_node(NULL, NULL, "apple,t8132-pmgr") check (with of_node_put()) so the pass keys on the PMGR block rather than the root machine compatible.
  3. Reworded the comment and commit message to state explicitly as an assumption that the 26.6.2-qualified PMGR ownership policy applies on newer firmware (noting that a domain newly claimed by newer firmware would otherwise stay Linux-owned).

Verified on host: checkpatch.pl --strict (0 errors, 0 warnings) and compiled drivers/soc/apple/t8132-platform-handoff.o.

Pending HW verification before merge: boot this exact build on the J773g (27.2) and on a 26.6.2 machine confirming the handoff line and domain counts are unchanged.

Assisted-by: LLM (Gemini:4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor

All three points are addressed. The commit has a single Signed-off-by. The early return (t8132-platform-handoff.c:331-334) now keys on the apple,t8132-pmgr block that t8132_pmgr_policy() walks. The comment and commit message give the 26.6.2 policy on newer firmware as an assumption. Nothing new in the diff. LGTM once the rows are in.

Rows still needed on this head: the J773g on 27.2, and a 26.6.2 M4 whose handoff line (node and property counts) is unchanged. On a J713 the handoff line and domain states should match the base kernel.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Live J773g (T8132, macOS 27.2 26B123) verification row (7.3.0-ARCH-m4prod4, stock t8132-j773g.dtb, 3/3 s2idle cycles PASS, 0 oops/warnings/SErrors):

[    0.000000] OF: reserved mem: 0x00000105fff70000..0x00000105fff73fff (16 KiB) nomap non-reusable uat-handoff
[    0.011009] calling  t8132_platform_handoff+0x0/0x2ac @ 1
[    0.015147] t8132-platform-handoff: supplied 0 platform nodes, 127 PMGR policy properties
[    0.015192] initcall t8132_platform_handoff+0x0/0x2ac returned 0 after 4000 usecs

Assisted-by: LLM (Gemini:4 Neon)

techmore added a commit to techmore/linux that referenced this pull request 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]>
@DjDeveloperr
DjDeveloperr marked this pull request as ready for review November 30, 2026 20:45
@DjDeveloperr
DjDeveloperr requested review from a team as code owners November 30, 2026 20:45
@github-actions github-actions Bot added area:platform Area from CODEOWNERS (bot) merge-conflict Conflicts with the base branch (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 30, 2026
@github-actions

Copy link
Copy Markdown

Merge readiness at 39478e3b: not ready yet

Check Detail
CI at head ok 7 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head no no line with the head SHA 39478e3b, a Mac and a result in the PR body or a comment
Conflicts no merge conflicts with main: merge it in (no force push)
PR text adopt when you next edit add a 'Tested:' line; a 'Risk:' line (door and Macs) (guide)

Areas: area:platform

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

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: REQUEST CHANGES at 39478e3b

Blockers:

  1. Branch is CONFLICTING with main. Rebase/merge current main so drivers/soc/apple/t8132-platform-handoff.c applies cleanly (MERGEABLE), full CI runs, and an exact-head J773g (27.2) + 26.6.2/Air regression row can be verified.

Checked:

  • Diff (drivers/soc/apple/t8132-platform-handoff.c, +15/-2): keys PMGR policy on apple,t8132-pmgr while keeping PMP/GFX compatibility nodes behind apple_t8132_firmware_path(), properly calling of_node_put(pmgr).
  • Prior J773g (27.2) 3/3 s2idle pass at 39478e3b (2026-11-22).
Evidence
  • Code logic is clean and well-scoped; rebase onto main to clear CONFLICTING (or close if already superseded on main).

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: MERGE at 39478e3bdd1f

Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.

Checked: - Diff (drivers/soc/apple/t8132-platform-handoff.c, +15/-2): keys PMGR policy on apple,t8132-pmgr while keeping PMP/GFX compatibility nodes behind apple_t8132_firmware_path(), properly calling of_node_put(pmgr).

  • Prior J773g (27.2) 3/3 s2idle pass at 39478e3b (2026-11-22).

Follow-ups (not blocking): rebase off CONFLICTING main; J773g 27.2 + 26.6.2/Air regression row

This branch has not been deployed

No deployments
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) merge-conflict Conflicts with the base branch (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants