Skip to content

soc: apple: pmgr: whole-word T6000 DCS commands and valid-state checks - #797

Merged
RyanTheTide merged 3 commits into
aurora-wipfrom
dcs/whole-word-write
Nov 2, 2026
Merged

RyanTheTide merged 3 commits into
aurora-wipfrom
dcs/whole-word-write

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

The T6000 DCS provider changed the DRAM state with a read-modify-write of the low nibble of the power-state register, so a vote from the boot state 9 to 7 wrote 0x997. On the M1 Pro that hard-hung the SoC with no kernel message, twice. Raw state 8 is also not a valid T6000 DCS state, and nothing stopped a table from using it.

Fix:

  • Write the whole 32-bit command in one store (0x7, 0x9, upper bits zero), then poll the actual state as before. Old status bits are never written back, and rollback and suspend/resume use the same whole-word path.
  • Validate every table entry against the T6000 raw-state set {5, 6, 7, 9} at probe, and reject anything else at runtime (8, and 15, which belongs to fabric). The fabric writer is untouched.
  • The binding lists the valid raw states, and the driver documentation describes the command format.
  • KUnit cases for the command words, invalid-state rejection, table validation, an unsettled current state and rollback (13/13).

How tested: M1 Pro (J316s), lab kernel = this branch plus a test overlay with raw states 7 and 9, bootguard armed with a fleet kernel fallback. The 9 -> 7 -> 9 -> 7 -> 9 votes all confirmed and oversubscription was rejected, with no hang. Previously the first 9 -> 7 vote hung the machine. Measured sustainable bandwidth over 3 passes with concurrent CPU and GPU streaming, CV under 6%: raw 7 about 109-123 GB/s, raw 9 about 144-164 GB/s, depending on read, write or copy. The proposed table (80% of the 5th percentile) is raw 7 = 86537369 kB/s and raw 9 = 107474819 kB/s. It is not part of this PR. Suspend with the provider bound was not qualified, because sleep is disabled on that machine.

🤖 Generated with Claude Code

…tates

T6000 DCS accepts raw states 5, 6, 7 and 9. Write only the selected raw command as a complete 32-bit store, including rollback and T6000 suspend/resume, instead of replaying status bits from an earlier read. Keep fabric accesses separate and reject unsettled current state before a vote.

Exercise command words, invalid raw states, table validation and rollback with a hardware-status model in KUnit.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Use the DCS state set 5, 6, 7 and 9. Raw 8 is invalid and fabric state codes belong to a separate controller.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Document the sparse raw-state allowlist, whole-word commands and settled-state requirement. The existing sleep floor remains a policy choice, not a validity floor.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide merged commit 8213bf4 into aurora-wip Nov 2, 2026
@RyanTheTide
RyanTheTide deleted the dcs/whole-word-write branch November 2, 2026 14:40
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merged after the suspend check this PR was missing. On the M1 Pro (J316s), with a one-shot of 7.3.0-aurora-prr1103 (aurora-wip c243830 plus the open aurora-wip PRs, this one included), using the stock DT with no DCS table, so the provider's only DCS writes are the suspend and resume ones:

  • Five pm_test=platform s2idle cycles. With dynamic debug on, every cycle logs DCS set 1 ps to pstate 7 on suspend and pstate 9 on resume, as whole-word commands. No hang, no WARN, resume devices 0.067 s each time.
  • The boot and post-cycle kernel logs have the same warning set as fleet14o, Wi-Fi stayed up, the SELinux gate passed with 0 AVCs, and the battery is present.
  • KUnit apple-pmgr-dcs passes 13 of 13 under qemu. The full host suite matches the base.

A real sleep wasn't run, because the M1 Pro has no RTC wake and sleep.target is masked there. The machine is back on fleet14o and the one-shot files are removed. Logs: reports/prreview-20261103/m1pro-prr1103-*-dmesg.txt.

notmysegv pushed a commit to notmysegv/linux that referenced this pull request Nov 4, 2026
…nto integration/aurora

Bring integration/aurora up to the aurora-wip tip 9ff2b9a. After this
merge the two branches have the same tree.

The range contains the fleet14o source c243830 (aurora-silicon#857, aurora-silicon#858, aurora-silicon#795,
aurora-silicon#859), which was promoted on all four machines on 2026-11-02 and 03, and
the merges after it: aurora-silicon#861 (apple-dcp selftest stubs for aurora-silicon#858), aurora-silicon#860
(SEP keybag in the shared xART window, the aurora-wip copy of aurora-silicon#856),
aurora-silicon#724 (J616s boot NOR, both parts), aurora-silicon#779 (ALS colour temperature ABI),
aurora-silicon#862 (J700 GD25UF16E boot NOR, the Neo bless fix), aurora-silicon#863 (J616s ANE H16
start stall), aurora-silicon#797 (T6000 DCS whole-word writes) and aurora-silicon#803 (G17 keeps
innocent clients alive across another client's recovery).

aurora-silicon#858 and aurora-silicon#860 make the same changes integration/aurora already had as
aurora-silicon#855 and aurora-silicon#856, so they merge without conflicts.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
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.

1 participant