Skip to content

T8132: enable deep sleep at the SoC for every board; s2idle stays the default where the DT lacks a part - #3629

Merged
DjDeveloperr merged 8 commits into
mainfrom
sleep/t8132-soc-enable
Dec 3, 2026
Merged

DjDeveloperr merged 8 commits into
mainfrom
sleep/t8132-soc-enable

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Deep sleep on T8132 (M4) was enabled in the J713 tree only. This moves the SoC parts to t8132.dtsi so every T8132 board has the sleep controller bound, and makes the driver keep s2idle the default on any board whose tree is missing a part that every deep sleep needs.

Commits:

  1. soc: apple: sleep: keep s2idle the default when the DT lacks a sleep part. T8132 is a qualified SoC, so deep becomes the default as soon as the node binds. A board that is missing a required part then has every deep sleep refused after the devices have suspended, and the system has no working sleep at all. At probe the driver now checks the device tree, names each missing part with a deep sleep: ... warning, and leaves s2idle the default. Deep stays in /sys/power/mem_sleep, and mem_sleep_default=deep is honoured. The checks:

    • display[0] disabled;
    • on T8132, the DCP has no apple,display-power;
    • no ANS PCIe tunables (windows or the loader's tables);
    • a apple,managed-sids host whose pci@0,0 lacks reset-gpios or clkreq-gpios.
  2. PCI: apple: drop the J713 machine check from the radio's sleep recovery. Every other condition in apple_radio_register() and the bind already checks the hardware. A host under the managed contract that has no recovery refuses every deep sleep in .prepare. The J715's radio port is the J713's.

  3. arm64: dts: apple: t8132-j713-j715: share the J713's sleep wiring with the J715. This moves the following from t8132-j713.dts to the shared dtsi unchanged:

    • the DCP display-power node, pmc-interface and the gapf reg;
    • the DISPEXT switched domains;
    • the DCP/display/USB4/dock DART clock-protection slices;
    • the radio clkreq-gpios;
    • the ACIO PHY links.

    The J715 ADT (27.0) has the same clock-protection-slice-index for each of those DARTs and the same radio function-clkreq/function-perst (AP 160/163) as the J713's. The J713's &pcie0/&dart_apcie0 okay overrides are dropped because t8132-jxxx.dtsi already enables both on every board. This is the J715 part of the closed arm64: dts: apple: t8132-j713-j715: give the J715 the J713's sleep, enclave and display power wiring #2245.

  4. arm64: dts: apple: t8132: enable deep sleep and the enclave on every board. This enables the sleep controller, the cluster power gates, sep_dart and sep (with power-domains = <&ps_sep>, <&ps_gpio>) in t8132.dtsi. ps_sep becomes firmware-owned in t8132-pmgr.dtsi, and the J713/J715 PMGR policy no longer disables it. The J713 keeps no sleep overrides of its own.

What each board gets on main with this PR (from the built DTBs):

Board Probe result
J713 Unchanged: deep stays the default.
J715 Same wiring as the J713: deep becomes the default.
J604 s2idle stays the default. Named: DCP has no apple,display-power; no ANS PCIe tunables (t8132-apcie-port2.dtsi drops the windows, fixed by #2762); radio port has no clkreq-gpios.
J623, J624 s2idle stays the default. Named: DCP disabled; no ANS PCIe tunables (until #2762); radio port has no clkreq-gpios.
J773g s2idle stays the default. Named: DCP disabled; no ANS PCIe tunables (until #2762). With #2762 only "DCP disabled" remains.

#2763 changes the prepare-time rule to accept a disabled display[0] when the external DCPs are bound. Its probe-time counterpart is the first check in apple_sleep_undescribed(), and it should follow #2763's rule once that lands. Until then deep is offered on the J773g but is not the default.

History: #2245 (the J715 part) was closed because it "turns on deep sleep, the enclave and display power gating on a J715 that nobody has booted with them; it can come back with a J715 row". The lane's direction since then is to enable at the SoC with no board gating. This PR therefore includes the J715 (deep by default, plus DCP power gating while blanked and the switched DISPEXT domains), and a J715 row is a merge condition below.

Tested:

  • make ARCH=arm64 LLVM=1 W=1 apple/t8132-{j604,j623,j624,j713,j715,j773g}.dtb: all build. The J713 keeps its 14 dtc warnings. Every other board gains only the two unique_unit_address_if_enabled warnings for the now-enabled sleep-controller@380700000, which the J713 already has.
  • J713 DTB, dtc -s before/after: identical, phandles included, except five status = "okay" lines (sep_dart, cluster_pwrgate, ps_sep, sep, sleep) that are now the default. At commit 3 alone, the J713 is identical to main.
  • J715 DTB: gains exactly the J713's sleep wiring. J604/J623/J624/J773g: only sleep, cluster_pwrgate, sep, sep_dart enabled, sep power-domains and ps_sep firmware-owned.
  • drivers/soc/apple/t8132-platform-data.dts (legacy-loader adapter, includes t8132-j713-pmgr.dtsi): preprocessed and sorted output is identical before/after.
  • drivers/soc/apple/sleep.o and drivers/pci/controller/pcie-apple.o: LLVM=1 W=1, no warnings. The same holds merged with soc: apple: admit M4 Mac mini (J773g) in T8132 SEP profile and desktop apple-sleep gates #2763 and arm64: dts: apple: t8132-apcie-port2: keep shared APCIe register windows #2762 (both merge cleanly with this branch). arm64: dts & PCI: apple: enable J773g port 2 Ethernet and T8132 multi-port deep sleep #2770 has the same two conflicts against this branch as against main.
  • KUnit apple-sleep-soc-data (arm64 16K pages, qemu): 14/14 passed.
  • checkpatch.pl --strict on each commit: 0 errors, 0 warnings, 0 checks.
  • No Mac booted for this PR.

Risk: two-way · M4 (T8132: J713, J715, J773g, J604, J623, J624); a plain revert undoes it.

  • J715: deep sleep, enclave domains, DCP power gating while blanked, switched DISPEXT domains and the radio's native sleep recovery are all new and have not been run on a J715.
  • J604/J623/J624/J773g: the sleep controller, the P-cluster power gate enable and the SEP (with ps_gpio held through its device link, ps_sep firmware-owned) now bind at boot. Deep is not the default there, but these blocks are new on those boards.
  • The probe checks cover only what the DT shows. Refusals that depend on firmware, such as the DCP's firmware-27 stop on an older DCP firmware, are still runtime refusals.
  • Legacy loader (J713/J715 tree): ps_sep is no longer J713-only in t8132-platform-data.dts (98552c2); the ACIO states still are.
  • A docked J715 deep sleep: the NHI-owned PCIe-C sleep in pcie-apple.c still checks apple,j713, so a J715 tunnel takes the older path. This PR does not change that.

Merge conditions:

Dependencies: none to build or merge. For the J773g, #2762 (ANS windows) and #2763 (display rule) are needed before deep can work there. #2770 is independent.

Rows so far: J713 (lab) PASS with #2673 under this PR, s2idle 1/1 + deep 3/3 (comments below). Merge after/with #2673 (#3555).

…part

On a qualified SoC deep sleep becomes the default mem_sleep state as soon
as the sleep controller binds. Some of what every deep sleep needs is
known from the device tree at probe, and a board whose tree leaves it out
has every deep sleep refused: at .enter for the display coprocessor and
ANS's PCIe block, at the PCIe host's .prepare for the managed radio. The
devices resume and the suspend fails, so with deep as the default such a
machine has no working sleep at all, s2idle included.

At probe, name each such missing part and leave s2idle the default when
any is missing. Deep sleep is still offered in /sys/power/mem_sleep, and
mem_sleep_default=deep still makes it the default. The parts:

 - the first display coprocessor disabled, while apple_sleep_refuse()
   wants its driver bound;
 - on T8132, its node without apple,display-power: the DCP's
   firmware-27 stop takes its power words from there, and without them
   the firmware keeps running;
 - no PCIe tunables for ANS (the windows or the loader's tables) on a
   SoC that restores ANS's PCIe block itself;
 - a PCIe host with the managed radio contract whose radio port (pci@0,0)
   has no reset-gpios or clkreq-gpios: pcie-apple-radio.c can't recover
   the radio, and the host refuses every deep sleep.

Each check is by what the device tree describes, so a board gets deep
sleep by default once its tree has the parts.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The native radio sleep recovery was registered only on a machine
compatible with apple,j713. Every other condition it checks is the
hardware the device tree describes: a T8132 host with the managed radio
contract (SIDs 1 and 2), a single port at index 0 with its PHY, the
radio's PERST# and CLKREQ# on the AP pins 163 and 160, the loader's
tables and the two BCM4388 functions. A host with the contract and no
recovery refuses every deep sleep in its .prepare.

The J715 is the J713's board with the same radio port (its ADT has the
same function-perst and function-clkreq), so it needs the recovery for
deep sleep too. Drop the machine check: a board without the port's
CLKREQ# in its tree, or with another radio, still fails the bind with a
warning, as before, and the sleep controller keeps s2idle its default.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…h the J715

The J715 is the J713's board with a bigger panel, six amps and its own
radio island and ATC PHY trims. The deep sleep's wiring sat in the J713
tree only: the internal DCP's display power words and PMC interface, the
DCP and display DARTs' clock protection slices, the external DCPs'
switched power domains, the USB4 and dock DARTs' slices, the radio
port's CLKREQ# and the ACIO hosts' PHY links.

The J715's ADT (macOS 27.0) has the same clock-protection-slice-index
for every one of those DARTs as the J713's (dcp 42, disp0 8, dcpext0 5,
dispext0 4, dcpext1 30, dispext1 29, acio0 15, acio1 19, apciec0 14,
apciec1 18), and the same function-clkreq and function-perst on the radio
port (pci-bridge0, AP GPIOs 160 and 163). Move the blocks unchanged into
t8132-j713-j715.dtsi, keeping only the panel in the J713 tree.

The J713's &pcie0 and &dart_apcie0 status overrides are left out:
t8132-jxxx.dtsi enables both on every T8132 board already.

The J713's DTB is unchanged in content. On the J715 this turns on the
DCP's display power gating while blanked and the external DCPs' switched
domains, which no one has run on a J715 yet.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…board

Deep sleep, both CPU clusters' power gates and the enclave with its
power domains were enabled in the J713 tree only. None of it is the
board's: the sleep controller, the cluster power gates, the SEP, its
DART and its power state are SoC blocks at the same addresses on every
T8132, and the ADT ap-wake-sources the sleep node's wake list comes from
are the same on the J713, J715 and J773g.

Enable them in t8132.dtsi. The SEP's domains move into its node, and
ps_sep becomes firmware-owned in t8132-pmgr.dtsi, as the J713 had it:
the enclave gates it itself and Linux only reads it. The J713/J715 PMGR
policy no longer disables ps_sep. The J713 tree keeps no sleep override
of its own; its DTB is unchanged apart from five status = "okay"
properties that are now the default.

Every other board now has the sleep controller bound. Where its tree
leaves out a part every deep sleep needs, the controller keeps s2idle the
default and names the part ("soc: apple: sleep: keep s2idle the default
when the DT lacks a sleep part"): on main that holds for the
J604 (no apple,display-power on its DCP, no ANS PCIe windows, no radio
CLKREQ#), the J623 and J624 (DCP disabled, no ANS PCIe windows, no radio
CLKREQ#) and the J773g (DCP disabled, no ANS PCIe windows). The J715,
with the J713's wiring, gets deep sleep as its default.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide requested review from a team as code owners November 29, 2026 15:27

@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 747e5567 — the 4-commit diff (+243/-180 across sleep.c, pcie-apple-radio.c, and T8132 DTS/PMGR files) is clean and code-ready; awaiting queued hosted CI and the required T8132 hardware verification rows.

Blockers:

  1. Wait for queued hosted CI (apple-build, dt-checks, host-tests, kunit, source, rust-build, DWC3/ATC, pr-text, readiness, KUnit suites) to pass at 747e5567.
  2. Post the exact-head 747e5567 hardware verification rows listed in the PR merge conditions: J713 (undocked + docked deep sleep unchanged), J715 (boot, Touch ID, deep sleep with/without dock, display blank/unblank), J773g (with #2762/#2763), and J604/J623/J624 (boot confirming s2idle stays default with the expected deep sleep: lines and clean SEP bind).

Checked:

  • drivers/soc/apple/sleep.c (6418ae82): verified apple_sleep_undescribed() cleanly mirrors the runtime refusal conditions (disabled display[0], missing apple,display-power when display_power_dt is set on T8132, !s->soc->regions && s->soc->ps.ans && !s->apcie_phy_tunable matching L3642, and managed-SIDs pci@0,0 missing reset-gpios/clkreq-gpios), balances of_node_put(radio) and of_node_put(host) on every path, and keeps mem_sleep_current = PM_SUSPEND_TO_IDLE unless mem_sleep_default=deep was explicitly requested.
  • drivers/pci/controller/pcie-apple-radio.c (7eb30d04): verified dropping of_machine_is_compatible("apple,j713") leaves apple_radio_bind() failing cleanly with a warning (leaving pcie->radio = NULL without aborting PCIe probe) on T8132 boards lacking clkreq-gpios (J604/J623/J624).
  • T8132 DTS/PMGR (57b96ad4, 747e5567): verified all J713 deep-sleep wiring (dcp_power, dcp_dart/disp0_dart/usb4_*_dart/dcpext*_dart/dispext*_dart clock protection slices, ps_dispext* consumer-switched domains, &port00 clkreq-gpios, &usb4_{0,1}_acio cio PHYs) moves cleanly into t8132-j713-j715.dtsi, and cluster_pwrgate, sleep, sep_dart, sep, and ps_sep (apple,firmware-owned) move cleanly to t8132.dtsi/t8132-pmgr.dtsi with status = "disabled" removed from t8132-j713-pmgr.dtsi (DCO Signed-off-by: present on all 4 commits).
Evidence
  • drivers/soc/apple/sleep.c L7963–8015, L8540–8545: for_each_available_child_of_node(host, port) breaks with radio = port and releases with of_node_put(radio) + of_node_put(host).
  • drivers/pci/controller/pcie-apple-radio.c L709–737: apple_radio_register() retains apple,t8132-pcie, managed_sids == (BIT(1) | BIT(2)), !piodma_supplier, singular port 0, nvecs == 32, port_msiaddr_hi, and port_msimap checks; missing clkreq-gpios logs dev_warn and returns cleanly.

@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) blast:none Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (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 29, 2026
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Merge readiness at 2c2788a9: not ready yet

Check Detail
CI at head ok 11 checks passed
Review no approved by DjDeveloperr, but GitHub does not count it yet (code owner from Core or Omarchy Mac needed, or approval went stale)
Requested changes ok none
Hardware row at head ok comment at 2c2788a9
Conflicts ok none
PR text ok Risk: two-way · M4 (T8132: J713, J715, J773g, J604, J623, J624); a plain revert undoes it. - J715: deep sleep, enclave domains, DCP power gating while blanked, switched DISPEXT domains and the radio's native sleep recovery are all new and have not been run on a J715. - J604/J623/J624/J773g: the sleep controller, the P-cluster power gate enable and the SEP (with ps_gpio held through its device link, ps_sep firmware-owned) now bind at boot. Deep is not the default there, but these blocks are new on those boards. - The probe checks cover only what the DT shows. Refusals that depend on firmware, such as the DCP's firmware-27 stop on an older DCP firmware, are still runtime refusals. - Legacy loader (J713/J715 tree): ps_sep is no longer J713-only in t8132-platform-data.dts (98552c2); the ACIO states still are. - A docked J715 deep sleep: the NHI-owned PCIe-C sleep in pcie-apple.c still checks apple,j713, so a J715 tunnel takes the older path. This PR does not change that. Merge conditions: - J713 lab row: undocked and docked deep sleep, unchanged from main. - J773g row from DjDeveloperr (on #2762 and #2763). - J715 owner row: boot, Touch ID enroll/match, deep sleep with and without a dock, display blank/unblank. - iMac (J623/J624) and J604 owner rows: boot, check that s2idle is the default and the deep sleep: ... lines name the parts listed above, and check that the SEP binds. Dependencies: none to build or merge. For the J773g, #2762 (ANS windows) and #2763 (display rule) are needed before deep can work there. #2770 is independent. Rows so far: J713 (lab) PASS with #2673 under this PR, s2idle 1/1 + deep 3/3 (comments below). Merge after/with #2673 (#3555).

Areas: area:bringup, area:platform

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

The platform data for the original J713 loader tree, which the J715
shares, kept the SEP power domain for the J713 alone
("apple,policy-machine"). The policy then turns ps_sep off on a J715
before anything probes, even though the SoC tree now enables the
enclave on every T8132 board, and apple_sep fails its probe with
-ETIMEDOUT ("could not keep the power domains on"). Deep sleep needs
the enclave bound, so the J715 could never sleep.

Drop the machine restriction from ps_sep. The ACIO power states stay
the J713's.

Reported in linux#3465 (J715, deep sleep working once ps_sep was
allowed there).

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J713 row (lab), 2026-11-30, at 747e556, plus a new commit

The kernel was main 498d53f + this PR at 747e556, with the J713's fleet85 config. One-shot BLS entry; the saved fleet85 entry and DTB were not changed. The J713's DT content is the same as before (it comes from Stage 2), so this row tests the driver side.

fleet85 (saved) main 498d53f (control) main + #3629
probe deep sleep is the default, native radio sleep recovery registered same same; the new check reports no missing parts on the J713
kernel errors at boot 3 6: both dcpexts probe failed: -110, bpf-restrict-fs 6, the same set
s2idle x1 (rtc1) - PASS PASS (eDP, Wi-Fi, BT, NVMe back)
deep x1 (rtc1, about 90 s after boot) PASS (everything back) resets to the saved default resets to the saved default

So on the J713 this PR behaves exactly like main. The deep reset is already on main without it: this is #3555. #2673's body: "without this handoff, a deep sleep in the first ~22 s after boot resets the J713 (both dcpext probes still in their RTKit handshakes)". Here both dcpext probes give up with -110. A J713 deep row that means something therefore needs #2673's stack under this PR. That's my next J713 slot.

New commit 98552c2 (fast-forward): soc: apple: t8132: give the legacy loader's SEP domain to every board. t8132-platform-data.dts kept ps_sep for apple,j713 only, so on a J715 (same legacy loader tree) the handoff turned the SEP domain off and apple_sep failed with -ETIMEDOUT. kazuhidet found this on his J715 in #3465. It now applies to every board that loads through that tree; the ACIO states stay J713-only. checkpatch --strict passes, and the built platform DTB has ps_sep okay + firmware-owned with no machine restriction.

Evidence: traces/power/20261130-j713-3629/ (lab store).

@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 98552c21d3e8

Blockers:

  • Hosted CI at 98552c21d3e8 is still running (9 passed, 0 failed, 28 queued/in-progress); also note pr-text previously flagged adding one-way or two-way to the PR body's Risk: line.
  • Exact-head hardware verification at 98552c21d3e8: awaiting the J713 deep-sleep row (over the #2673 stack, as noted in your comment) and the J715 / other T8132 board verification rows.

Checked:

  • Verified the incremental commit 98552c21d3e8 (drivers/soc/apple/t8132-platform-data.dts, +4/-2, DCO): removes apple,policy-machine = "apple,j713"; from &ps_sep while keeping apple,firmware-owned; and status = "okay";, aligning the legacy loader platform-data overlay with t8132.dtsi/t8132-pmgr.dtsi so J715 (and other T8132 boards booting through that tree) no longer power-gate ps_sep before apple_sep probes, while leaving the J713 ACIO power-state overrides scoped to apple,j713.
  • Confirmed the four prior commits (6418ae82..747e5567) remain unchanged and code-clean, and reviewed the J713 control-vs-patched s2idle row at 747e5567 confirming apple_sleep_undescribed() reports no missing parts on J713.
Evidence
  • drivers/soc/apple/t8132-platform-data.dts L40-48: &ps_sep retains apple,firmware-owned; and status = "okay"; without apple,policy-machine, matching t8132-pmgr.dtsi.
  • Live check status at review time: 9 passed, 0 failed, 28 queued/in-progress.

@github-actions github-actions Bot removed ci-failing A check failed at the PR head (bot) needs-hw-row No hardware row at the PR head (bot) labels Nov 29, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J713 row 2 (lab): PASS with #2673 under this PR

Kernel: this PR at 98552c2 merged with #2673 at 525da01 (local merge 9a16a506). The one conflict was in t8132-j713.dts: this PR's moved blocks, plus #2673's dcpext0/1_dart gapf reg carried into t8132-j713-j715.dtsi. The J713's fleet85 config was used, with a one-shot BLS entry; the saved fleet85 entry was not changed. The DT is the production Stage 2 DTB, which already carries #2673's DT.

  • Boot: both dcpexts bound, DP-1..4 present, all 4 external display DARTs locked roots kept (mirror). No -110 dcpext probe failures (main without drm/apple, soc: apple: external displays on the M4 MacBook Air (J713) over USB-C on macOS 27.2 #2673 has two). Probe: deep sleep is the default, no missing parts reported, native radio sleep recovery registered.
  • s2idle 1/1 (rtc1): PASS.
  • deep 3/3 (rtc1, 20 s, same boot): PASS. back from sleep, boot object resumes 0 -> 1 -> 2 -> 3, suspend_stats success 4 / fail 0. After each wake: eDP on, Wi-Fi associated (0% loss), BT powered, NVMe reads 5.1–5.7 GB/s, GPU firmware back in 0.6–0.75 ms, 0 firmware crashes, 0 oops. Vulkan sees the Apple M4 (G16G B0) afterwards.
  • Same on fleet85's own deep wake (pre-existing, not from this PR): GPU stop at the commit ... (-110) once, dma-controller isn't bound, dwc3 genpd_prepare returns -11.

So on the J713 this PR is no-regression, and deep works once #2673 is in, which is what #3555 says. Merge order: #2673 before (or with) this PR. Lab Mac restored to fleet85 (saved entry, no next entry, test entry removed, 0 failed units, Enforcing).

Remaining merge conditions: Dj's J773g row (with #2762/#2763), and a J715 owner row (asked on #3465). There is no iMac / J604 owner yet; those boards stay on s2idle by default under the new probe check until their DT describes the missing parts.

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) and removed needs-template PR body lacks Tested or Risk (bot) labels Nov 29, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Desktop follow-up for the J773g (and the iMacs), ready on branch sleep/t8132-desktop-follow: commit e64ec7c, soc: apple: sleep: follow the desktop display rule at probe. It sits on this PR merged with #2763.

#2763 changes the sleep's refusal: when the DT disables the internal DCP (J773g), it waits for every available external DCP instead. This PR's probe check still counts a disabled internal DCP as a missing part, so with #2763 in, a J773g would keep s2idle as the default for no reason. The commit makes the probe follow #2763's rule: the internal DCP counts only when it is available (it then needs its driver and apple,display-power). W=1 clean, checkpatch 0/0/0.

Ordering, so the probe and the refusal never disagree: the commit lands with whichever of #3629 / #2763 merges second. Before #2763, the refusal still waits for the internal DCP and this PR's check matches it. On a J773g with #2762 + #2763 + this commit, the remaining probe item ("no PCIe tunables for ANS") is gone too (#2762 keeps the shared APCIe windows), so deep becomes the default there. That is the stack the J773g row should use.

@kazuhidet

Copy link
Copy Markdown
Contributor

J715 row, 2026-11-30: at 98552c2 plus two local test changes, s2idle x1 and deep x3 passed on the J715 (MacBook Air 15-inch M4, Mac16,13).

One more J713-only check. At this head, apple_dart_sleep_bind() (drivers/iommu/apple-dart-sleep.c:122) still returns -ENODEV on anything but apple,j713:

	if (!of_machine_is_compatible("apple,j713") || !cfg || !cfg->stream_maps[0].dart ||
	    cfg->stream_maps[1].dart)
		return -ENODEV;

apple_radio_bind() returns that error, and then:

  • apple_radio_register() logs native radio sleep unavailable: -19 and leaves pcie->radio unset;
  • apple_radio_prepare() returns -EBUSY on every deep sleep.

That is what this J715 did on 11-28, before I let both checks through. I didn't boot the head without the change this time, so the refusal at this head is from reading the code, not from a run. With apple,j715 beside apple,j713 there, the radio registered and recovered on every sleep. Dropping the machine check, as 7eb30d0 did for the radio, probably fits better.

The two local changes:

Setup.

Boot:

[    0.074554] apple-sleep 380700000.sleep-controller: deep sleep is the default: boot object resumes 0
[    1.852595] pcie-apple 1cb0000000.pcie: native radio sleep recovery registered

/sys/power/mem_sleep: s2idle [deep].

Sleeps. One s2idle, then three deep sleeps, each woken by the RTC 20 s later. There are two RTCs:

  • rtc0 is macsmc-rtc, with no wakealarm;
  • rtc1 is apple-pmu-rtc, which did the waking.

I set the alarm on rtc1 and suspended with systemctl suspend, not rtcwake -m mem, so the speaker unit on sleep.target runs. The sleep and the wake are the same.

sleep woke by request → resume after the wake
s2idle 1 RTC 16 s ok
deep 1 RTC (NUB.SPMI0.SW3) 16 s ok
deep 2 RTC (NUB.SPMI0.SW3) 16 s ok
deep 3 RTC (NUB.SPMI0.SW3) 16 s ok
  • "ok" means the display, Wi-Fi (a gateway ping), BT, the keyboard and the trackpad all worked, each checked after each wake.
  • No key was pressed; every sleep woke by itself. These are this J715's first RTC-woken deep sleeps. The earlier ones were woken by a key (MTP.DOCK.CHANNELS.AP0.IRQ).

Each deep sleep, deep 2 here:

PM: suspend entry (deep)
pcie-apple 1cb0000000.pcie: radio sleep begin: link=0x9b000211
pcie-apple 1cb0000000.pcie: native radio DMA fenced, DART off
apple-sleep 380700000.sleep-controller: 11 coprocessors up and stopped
apple-sleep 380700000.sleep-controller: wake source: NUB.SPMI0.SW3
pcie-apple 1cb0000000.pcie: native radio power-loss recovery complete
apple-sleep 380700000.sleep-controller: 138 of 224 AP pins changed by the sleep, all put back
apple_sep 3aa600000.sep: the enclave is back from its sleep request
pcie-apple 1cb0000000.pcie: native radio transaction complete
PM: suspend exit
  • No refusals, no retries, and no kernel line at err level during any sleep.
  • After the last wake:
    • the six amps are still bound, and sn012776-sdz is enabled with 6 users;
    • there is no tas2764/macaudio line at warning or worse on the whole boot;
    • speakerguardd said protection ready 1.7–1.9 s after each resume;
    • the enclave's sleeps is 4, xART is still disabled, and xart_guard_refusals is 0.

Not tested:

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

@kazuhidet: thank you. That closes the J715 condition: exact head ffb43c7, no DART edit, native radio sleep recovery registered on its own, s2idle 1/1 + deep 3/3 RTC-woken, everything back, no refusals. The remaining #3629 condition is the J773g row (Dj, on sleep/t8132-desktop-follow). Merge order is after or with #2673.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

J773g (M4 Mac mini) row: pass, 3/3 deep sleeps with this PR at its head ffb43c7d, together with #2763 at bc54c7f2.

What ran:

One conflict, in drivers/soc/apple/sleep.c, t8132_sleep_soc: this PR adds .display_power_dt = true on the line next to #2763's disp_prot_slice change, { 0, 5, 30 } to { 42, 5, 30 }. I kept both lines. Nothing else conflicted. With both PRs, the J773g DTB is the same as with #2763 alone (sorted, phandles included). So on this board, only this PR's kernel changes are new.

Test: one boot on the default command line with the GPU driver loaded. Three deep sleeps, each woken by the PMU RTC (rtc1) after 15 s.

Wake boot object resumes Wake source Enclave Ethernet (port 2) Wi-Fi (port 0) SEP hwrng New warnings
1 0 -> 1 NUB.SPMI0.SW3 back from its sleep request 1000/full carrier 32 bytes 0
2 1 -> 2 NUB.SPMI0.SW3 back 1000/full carrier 32 bytes 0
3 2 -> 3 NUB.SPMI0.SW3 back 1000/full carrier 32 bytes 0

At probe, as the PR describes for the J773g:

apple-sleep 380700000.sleep-controller: deep sleep: /soc/dcp@30ae00000 is disabled, no driver can stop the display coprocessor
apple-sleep 380700000.sleep-controller: deep sleep needs the parts named above: s2idle stays the default

/sys/power/mem_sleep reads [s2idle] deep, so the row chose deep by writing deep to it. Deep works on this Mac with the internal DCP disabled. Once #2763 lands, the probe check should accept a disabled display[0] when the external DCPs are bound, so that deep becomes the default here.

Stock for comparison (7.3.0-ARCH-m4mainefed1ae3, before and after): /sys/power/mem_sleep is [s2idle] only. The sleep controller, the cluster power gate, the SEP and its DART are disabled, there is no hwrng, and port 2 has no Ethernet interface. Wi-Fi has carrier. The Mac went back to stock with 0 failed units.

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

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: Removing the machine check allows the J715 radio to reach DART sleep binding. The single-stream, ready managed DART, APCIe resource, and protection syscon checks still constrain it to the supported block. The J715 run with local changes supports the fix and exercised s2idle and deep resume. Please keep the tested kernel and its boot-only DT delta explicit, and retain current-head J713, docked J715 and the other T8132 coverage already listed in the PR.

Follow-ups (not blocking): hosted CI; J713, docked J715 and listed T8132 rows; keep tested kernel/DT delta explicit

@github-actions github-actions Bot added merge-conflict Conflicts with the base branch (bot) and removed merge-conflict Conflicts with the base branch (bot) labels Dec 1, 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.

The series is right, and the J713, J715 (exact head) and J773g rows cover it. The three machine checks are replaced by hardware checks, and a board missing a sleep part keeps s2idle instead of failing every deep sleep. One blocker, which comes from your own 11-29 23:28 comment and is real now that #2763 is in main.

Blocker: on the J773g this makes s2idle the default again. #2763 (merged) lets a desktop whose DT disables the internal DCP sleep by waiting for its external DCPs. This PR's probe check still counts a disabled display[0] as a missing part (sleep.c, the new "deep sleep: ..." check). So on the J773g, mem_sleep falls back to s2idle at boot, while main defaults to deep. The J773g row passed because it forced deep sleep. Fix: fold e64ec7ce ("soc: apple: sleep: follow the desktop display rule at probe", on sleep/t8132-desktop-follow) into this PR when you merge main. It conflicts with main now anyway. The internal DCP should count only when it's available.

After that, the J773g check is quick: boot shows deep sleep is the default with no missing parts, plus one deep cycle. I'll re-review at the merged head.

@github-actions github-actions Bot added the changes-requested A reviewer requested changes (bot) label Dec 2, 2026
DjDeveloperr and others added 2 commits December 2, 2026 15:15
Signed-off-by: DjDeveloperr <hey@djdev.me>
With "admit M4 Mac mini (J773g) ... desktop apple-sleep gates", the
sleep's refusal no longer waits for an internal display coprocessor the
device tree disables: it waits for every available external one, and
each of those has its own driver. The probe check still counted the
disabled internal DCP as a missing part, so a J773g kept s2idle as the
default even though nothing in its tree is missing.

Count the internal DCP only when it is available: it then needs its
driver bound and, on T8132, apple,display-power.

This goes in after the desktop gates; before them the refusal still
waits for the internal DCP and the old check matches it.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
(cherry picked from commit e64ec7c)
Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Pushed two commits, no rebase or force-push:

  • 908ed8aa1375 merges main. Two conflicts:
    • t8132-j713.dts: this PR moves the J713 sleep wiring into t8132-j713-j715.dtsi, and main has since given dcpext0_dart/dcpext1_dart their gapf reg on the J713. I kept that as a J713-only override, so the J713 keeps exactly what main has and the J715 gets what its rows tested. With properties sorted, the J713 DTB differs from main only by five redundant status = "okay" lines, and the J773g DTB is identical.
    • sleep.c: main split the untested-SoC warning out of the derived block. The "s2idle stays the default" fallback is now its own if (!s->soc->derived && apple_sleep_undescribed(s) && ...), which keeps the old else meaning, and T8132 is not derived. The T8132 entry keeps main's disp_prot_slice = { 42, 5, 30 } next to this PR's .display_power_dt = true.
  • 2c2788a9e76e is Ryan's e64ec7ce ("follow the desktop display rule at probe"), cherry-picked as the 12-02 review asked, with authorship kept. A disabled internal DCP no longer counts as a missing part, so the J773g keeps deep as the default.

Local checks against a warm arm64 config: sleep.c, apple-dart.c (includes apple-dart-sleep.c) and pcie-apple.c (includes pcie-apple-radio.c) compile with 0 warnings, the same as main. cpp+dtc of J713, J715 and J773g give the same warning counts as main. Left before merge: hosted CI at this head, an independent review of the merge (I pushed it), and the quick J773g check: boot shows deep sleep is the default with no missing parts, plus one deep cycle.

@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) and removed ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) labels Dec 2, 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.

Approve at 2c2788a9e76e. This replaces my 12-02 changes-requested review: the blocker is fixed.

The added commit is Ryan's e64ec7ce byte for byte, with authorship kept, so a disabled internal DCP no longer counts as a missing part. The main merge 908ed8aa1375 differs from a clean git merge-tree of its parents only in t8132-j713.dts and sleep.c, and both are resolved right:

  • t8132-j713.dts: main's DCPEXT GAPF regs stay a J713-only override, and the moved sleep wiring lives in t8132-j713-j715.dtsi.
  • sleep.c: main split untested into untested and derived, and the fallback now runs for !derived. That keeps it off T8142 and T8122, which this PR's base excluded through untested, so the scope the PR was tested with is unchanged. Main's disp_prot_slice 42 is kept.

Checked on pc:

  • sleep.o, apple-dart.o (which includes apple-dart-sleep.c) and pcie-apple.o (which includes pcie-apple-radio.c): W=1, 0 warnings.
  • All 141 Apple DTBs at this head against its main parent 87c01c2c901d. J713 only loses five redundant status = "okay" lines. J715 gains the J713's sleep wiring. J604, J623 and J624 gain the sleep controller, cluster power gate, SEP and firmware-owned ps_sep. J773g is unchanged. dtc W=1 adds only the two known unique_unit_address_if_enabled warnings on each newly enabled board, as the PR says. Hosted dt-checks passed.
  • checkpatch --strict on the cherry-pick: clean. Merges cleanly with current main.

One correction to the J773g row I asked for (not a code problem): on main as it is now, it can't show "deep sleep is the default". The J773g's ANS PCIe node only has config, rc, port0, phy0, port2 and phy2: t8132-apcie-port2.dtsi replaces reg-names and drops the five shared windows, and #2762, which kept them, was closed. So apple_sleep_map_apcie() finds no ANS tunables, and the new probe check keeps s2idle the default with "deep sleep: no PCIe tunables for ANS". That is the right result. NVMe registers ANS as a pcie_ans coprocessor on T8132, and apple_sleep_refuse() refuses every deep sleep with ANS idled and no tunables, so a deep default there would fail every suspend. The J773g row should check instead that the only deep sleep: line is the ANS one (no DCP line, which is what e64ec7ce removes), that s2idle is the default, and that one s2idle cycle works. Deep as the J773g default needs those windows back in a separate change.

Before merge: hosted CI and that J773g row. The commits were pushed from this account, so it needs another approver or an admin merge.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

J773g (Apple M4 Mac mini, T8132, firmware 27.2) receipt at exact head 2c2788a9e76e444966a4f28879ee78ac1d25a1a3 (without #4007), kernel 7.3.0-j773g-comp6a (boot_id=57875cbc-9f1a-4e72-94aa-866d4d596113): PASS (standalone #3629 s2idle-default row).

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Dec 2, 2026
@DjDeveloperr
DjDeveloperr merged commit cff8756 into main Dec 3, 2026
13 checks passed
@DjDeveloperr
DjDeveloperr deleted the sleep/t8132-soc-enable branch December 3, 2026 06:01
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Merged at 2c2788a9e76e as cff875630c61, on main 664b5dbe4182. The merge commit's tree (b16b1e624913) is the tree checked here.

Not run: the full host-test list, the KUnit suites, dt-schema checks and a full kernel build on the merge (hosted CI was green at the head). No Mac booted the merge. J604, J623 and J624 still have no row, and J715's is at ffb43c7d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bringup Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) blast:none 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.

3 participants