Skip to content

soc: apple: pmp: take the T6041 data segment offset from the SRAM header - #3688

Merged
RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
allanclempe:fix/t6041-pmp-sram-data
Dec 1, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
allanclempe:fix/t6041-pmp-sram-data

Conversation

@allanclempe

Copy link
Copy Markdown
Contributor

What: The T6041 PMP restarts after a deep sleep on a macOS 27.2 stub. Its SRAM keep range now starts where the firmware's header says the data segment is (0x62000 on 27.2, 0x61000 on 26.6.2) instead of at the fixed 26.6.2 offset.
Tested: J616c (M4 Max) at f919dbb (with fix/t6041-dcp-s2r-fw27 and #3670 in the same tree): deep sleep 1/1, the PMP came back after the wake; 0 failed units, no new kernel errors.
Risk: two-way door · M4 Max (T6041); a plain revert undoes it. Boards whose boot loader passes apple,sram-keep are unchanged.
Not yet: a T6041 row on a 26.6.2 stub (the header gives 0x61000 there); whether 27.2's data segment outgrew 0x7d000 (the wake shows no sign of it).

Evidence

Tree: main 45d7f82 + this branch (f919dbb) + fix/t6041-dcp-s2r-fw27 (3294c96) + #3670 (0d460a7), nothing else, built as 7.3.0-1-2.1-ARCH, default command line, J616c with a macOS 27.2 (26B123) stub, no apple,sram-keep in its DT.

  • After the wake: apple_pmp 500700000.pmp: RTKit: Initializing (protocol version 12), and no endpoint discovery failed, firmware did not come back from sleep or PMP did not acknowledge requests.
  • Before the change, the same sleep on the same Mac woke with apple_pmp: RTKit: endpoint discovery failed: -62, firmware did not come back from sleep: -62, apple-pmp-report: PMP did not acknowledge requests 0x3c00 (ack 0x0). The PMP and its SRAM power words read off on the wake and on again after the restore (pmp 0xf000300 to 0x1f0003ff, pms_sram the same), so the SRAM had lost its contents.

HW_CFG_T6041 keeps 0x7d000 bytes from 0x61000 across a deep sleep,
where the 26.6.2 PMP firmware has its data segment. The 27.2 firmware
has it at 0x62000, as the config's comment notes. The sleep powers the
PMP's SRAM off, so on the wake the driver wrote back a range a page too
low and missed the top of the data segment, and the firmware didn't
come back (RTKit endpoint discovery -62, then no acknowledgement of the
PMP requests).

Take the offset from the firmware's SRAM header, as HW_CFG_T8132 does,
so both firmwares are covered; a boot loader's apple,sram-keep still
wins.

Signed-off-by: Allan Clempe <allan.clempe@gmail.com>
@allanclempe
allanclempe requested review from a team as code owners November 30, 2026 04:43
@github-actions github-actions Bot added area:platform Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Merge readiness at f919dbba: not ready yet

Check Detail
CI at head running running: KUnit isp, KUnit jpeg, KUnit prores, KUnit scaler, KUnit macsmc, KUnit clpc
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok in the PR body at f919dbba
Conflicts ok not computed yet
PR text ok Risk: two-way · M4 Max (T6041); a plain revert undoes it. Boards whose boot loader passes apple,sram-keep are unchanged.

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: HOLD at f919dbba

Blockers:

  • Fork pull_request CI workflows at f919dbba (Apple build and KUnit, Host tests, SEP source checks, pr-text) are action_required (awaiting maintainer approval to run); only pull_request_target skipped/readiness ran, so no hosted build or test has executed yet. Code and J616c deep-sleep verification look clean — ready to approve once CI runs green.

Checked:

  • drivers/soc/apple/pmp.rs: setting HW_CFG_T6041.sram_backup_data = true reuses the existing sram_range() header-lookup path (SRAM_DATA_START, word 0x234, same as HW_CFG_T8132), which rejects zero or non-4 KiB-aligned offsets (-EINVAL) and validates bounds via pmp_bootargs::word_range_valid(offset, size, io.size()), while preserving apple,sram-keep DT precedence (sram_backup_data = false when DT supplies the property).
  • Commit f919dbba carries a human Signed-off-by: trailer, clean PR metadata (Risk: two-way), zero AI attribution, and exact-head J616c (M4 Max, macOS 27.2 stub) deep-sleep verification showing clean PMP RTKit restart without -62 endpoint discovery failure.
Evidence
  • Diff audited: drivers/soc/apple/pmp.rs (+3/-2), commit f919dbba5c26.
  • Verified PmpData::new() (pmp.rs:218-225, DT apple,sram-keep override) and PmpData::sram_range() (pmp.rs:553-578, alignment + word_range_valid bounds checks).
  • Workflow runs at review time: Apple build and KUnit, Host tests, SEP source checks, and pr-text are pull_request completed/action_required (fork PR); pull_request_target jobs skipped.

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

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: - drivers/soc/apple/pmp.rs: setting HW_CFG_T6041.sram_backup_data = true reuses the existing sram_range() header-lookup path (SRAM_DATA_START, word 0x234, same as HW_CFG_T8132), which rejects zero or non-4 KiB-aligned offsets (-EINVAL) and validates bounds via pmp_bootargs::word_range_valid(offset, size, io.size()), while preserving apple,sram-keep DT precedence (sram_backup_data = false when DT supplies the property).

  • Commit f919dbba carries a human Signed-off-by: trailer, clean PR metadata (Risk: two-way), zero AI attribution, and exact-head J616c (M4 Max, macOS 27.2 stub) deep-sleep verification showing clean PMP RTKit restart without -62 endpoint discovery failure.

Follow-ups (not blocking): fork CI workflow approval

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging at f919dbba5c26 (B2 merge train, 12-01 merge bar). Approval at this head: aurora-silicon-review[bot]. Row: the hardware row at f919dbb that the readiness check found (PR body or comment). CI: linux train L4 = main (after L3) + 34 approved PRs (#3419 dropped: conflicts): Apple driver compile pass, Apple DTBs W=1 pass, planned KUnit ane-boot/clpc/ane-pm/dcp-fabric/dcp-topology/dcp-display/macaudio/asahi/sep all pass, host tests apple-dcp + apple-scaler-recovery pass (the red host-tests on some heads were base failures since fixed on main). The rest of the hosted run is queued behind the backlog. Revert: git revert -m 1 <merge commit>.

@RyanTheTide
RyanTheTide merged commit d5cbf5f into aurora-silicon:main Dec 1, 2026
33 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) blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants