Skip to content

soc: apple: enable T6030 suspend-to-RAM on J516s - #4067

Merged
DjDeveloperr merged 21 commits into
mainfrom
feat/t6030-sleep-provider-v3
Dec 3, 2026
Merged

DjDeveloperr merged 21 commits into
mainfrom
feat/t6030-sleep-provider-v3

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

What: Enable firmware suspend-to-RAM (deep) for the 16-inch M3 Pro (J516s) on OS firmware 27.2 (26B123). The T6030 sleep provider sequences the SMC and PMU handshakes and restores CPU, cache, power-domain, I2C6 and PCIe state. J514s keeps its sleep node disabled. On any OS firmware other than 27.2 the provider returns -ENODEV at probe before it maps or writes a sleep register, so s2idle stays the sleep state. This replaces #3818. #3809 is merged to main (5a13ea7b4b52), so pcie-apple.c is no longer part of this diff. It also keeps main's new check for missing sleep parts (apple_sleep_undescribed()) from taking the deep-sleep default away on T6030.

Tested: J516s (M3 Pro, T6030, 27.2) at f66d67e3a242: row, two separate boots of that commit. Boot A: refuse_late=1 refused the first entry, then 3/3 committed deep sleeps (191 s, 11 s, 11 s) and one s2idle, same boot ID throughout. Boot B: deep sleep committed on its first entry (16 s). In the journals of both boots there is no WARNING, BUG or SError line. Display came back, Wi-Fi answered, and the PCIe links, port DARTs and Bluetooth firmware came back after each wake. Not exercised: audio playback, an SD card, a USB device, a GPU workload. The current head is that one with main 5a13ea7b4b52 merged in, plus one condition in sleep.c. It was built and host-tested (see Evidence) and not booted. J514s and the other Macs were not run.

Risk: two-way door, a plain revert restores the old behaviour · J516s on 27.2 mainly. Shared code reached by other Macs: the SMC, SPMI, DART, PMP and PMGR hooks, and apple-sleep itself. Most of it is gated by SoC data or a device tree property. Not gated: the reworked power-domain wake-order loop in sleep.c. The late PCIe resume path came to main with #3809, which has its own rows: J414s, J516s and J714s. J514s gets the T6030 PCIe and ATC matches and no sleep node.

Not yet:

  • Short J516s check of the merge: the row above is from before the merge. Of the 17 sleep files in drivers/soc/apple, 16 are the same files as in that row; sleep.c has main's T8132/T8122 changes and the one new condition. Not booted yet: the probe line deep sleep is the default, and one deep sleep with Wi-Fi back.
  • Stage 2: the J516s ran Stage 2 1.0.0b17-g683a128b, which is not a commit in aurora-silicon/aura. aura b18 or later, and aura main dfe97a4b9783, were not tried on J516s with this PR.
  • SoC perf word: the probe writes 4 to the upper nibble of CLK_PERF_SOC; both boots read 0x1222 before and after, so the write had no visible effect.
  • Idle power: no same-base comparison. See Evidence for the spot readings.
  • J514s check: one s2idle with Wi-Fi and SD back. Also not run: a J516s on another OS firmware. There the sleep provider does not bind, but the device tree changes and the SMC transport choice (apple,smc-sleep-policy) still apply.
  • Follow-up after merge: move t6030_pwrgate_init(), t6030_cpm_init() and t6030_mem_config_apply() to the first deep-sleep entry, with its own J516s row.
Details
  • Gate t6030_sleep_map_regs() on exact /chosen/asahi,os-fw-version == "27.2" (t6030_firmware_ok(), returning -ENODEV before mapping or writing any registers on other firmwares).
  • Gate deep-sleep entry in t6030_sleep_begin() and t6030_sleep_final_check() on pcie-apple being bound and every available GP PCIe DART being host-resumed (apple_dart_is_host_resumed()).
  • Run the one-time T6030 boot-state setup in t6030_sleep_map_regs() behind the J516s DT opt-in (&t6030_sleep { status = "okay"; }) and 27.2 firmware gate after all DT resource, sequence, and wake-source validation succeeds, using pre-mapped DT "mca-switch".
  • Preserve the AP pin snapshot and ADT no-restore-gpio-pins skip bitmap (apple,pinctrl-skip-pins = <5 6 17>), restoring AP pin state when GPIO is powered before GP PCIe retraining, with a fallback after the early wake sequence.
  • Derive GP PCIe PERST# pins from each port's reset-gpios by PCI slot reg, replacing hardcoded pinctrl offsets in the quiesce tables.
  • Save and restore I2C6 power state and registers across deep sleep using the apple,i2c6 phandle, keeping &ps_i2c6 and &ps_spi2 (apple,always-on; apple,no-auto-pm;) and &spi2/&mesa (enable-gpios, CS delays, firmware-name = "apple/mesacal-j516s.bin") in t6030-j516s.dts.
  • Dynamically lower active group == 0 OFF-target PMGR domains in child-before-parent order at commit and restore them parent-before-child on undo so unbound DT consumers holding sync_state() do not block firmware sleep entry; guard apple_sleep_domain_kept() with pm_suspend_via_firmware() so s2idle is unaffected.
  • Scope apple,keep-pending-irqs to all three J516s apple,t6030-spmi buses (&nub_spmi, &nub_spmi_a0, &nub_spmi_a1), exclude driver-owned and RX-notify bits from the stuck-IRQ valve, match the J516s ADT smc-pmu wake reasons (including codec bit 10 and trackpadkeyboard bit 12), and use sleep-controller@3642d4000 (reg idx 0 = "commit", idx 5 = "ps").

Details — per-call justification for probe-time boot writes (t6030_sleep_map_regs(), answering the f0273427 review):
Deferring all six calls to first deep-sleep entry caused Cycle-1 Chapel watchdog resets (~73 s) on J516s (alongside the deleted spi2/i2c6/mesa DT nodes and missing apple,keep-pending-irqs on &nub_spmi_a1, all fixed in 4d76e17159c5). All six run only on J516s with OS firmware 27.2, after DT/mailbox/sequence/wake-source validation:

  1. t6030_boot_replay(s): runs the DWI boot pulse, zeroes the MCA audio-clock switches, and pulses ATC2_PCIE and ATC1_PCIE. At first deep-sleep entry, ATC2_COMMON has already been gated off by genpd_power_off_unused() and ATC1_PCIE is already active under CIO, causing both PCIe replay pulses to be skipped.
  2. t6030_pwrgate_init(s): enables the E- and P-cluster power-gate control registers required before t6030_cpm_init() accesses cluster CPM state.
  3. t6030_cpm_init(): zeroes CPM counters and clears the CPM B63 gating bits for both clusters alongside t6030_pwrgate_init().
  4. t6030_boot_auto_probe(s): sets PS_AUTO_ENABLE on active boot domains; running at first entry misses runtime-suspended domains (AUDIO_P, DPA0, UART0, UART_P).
  5. t6030_mem_config_apply(s): writes the 27.2-measured AMCC/DCS memory sleep table and sets the SoC perf upper nibble to 4 (T6030_PERF_SOC_HI_SLEEP), logging the CLK_PERF_SOC word before and after at probe.
  6. t6030_last_pmu_boot(s): reads and clears the PMU boot latches (0xf803 and 0xf808, leaving 0xf801/0xf802 untouched for macsmc-reboot) over raw SPMI at boot rather than right after rtcwake arms the RTC alarm.

Follow-up (separate issue/PR after merge): keep the DWI/ATC pulses, the AUTO pass, and the PMU latch clear at probe, and move t6030_pwrgate_init(), t6030_cpm_init(), and t6030_mem_config_apply() to first deep-sleep entry with its own J516s cold-boot verification row to remove most of the every-boot cost on s2idle-only boots.

Risk notes

  • Probe-time ATC1_PCIE/ATC2_PCIE replay order & kexec exception: the unconditional ATC1_PCIE/ATC2_PCIE pulse at probe would cut a USB4 PCIe tunnel if one were already up before apple-sleep probes. On J516s, built-in apple-sleep relies on drivers/Makefile link order (drivers/soc/ links before drivers/pmdomain/ and drivers/spmi/, and CONFIG_USB4=m/CONFIG_USB4_APPLE_SOC=m thunderbolt_apple is a loadable module), so no power domain, ATC PHY, SPMI driver, or USB4 tunnel is up at probe — except a USB4 PCIe tunnel left active by a kexec'd kernel.
  • s2idle-only boots on J516s 27.2: take the probe-time writes (~32 ms boot time, SoC perf upper nibble = 4, CPM/AMCC/DCS/AUTO bits, and ps_spi2/ps_i2c6 always-on keeping ps_spi_p/ps_sio on). Idle power comparison before/after is owed below.
Evidence
  • Receipt and logs: issuecomment-7377280209.
  • scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks for the PR at f66d67e3a242, and the same for 731c7e362763, the one new commit after the merge.
  • Host selftests run at f66d67e3a242: t6030-sleep-qblk, t6030-wiring (26/26), m3-sleep-steps (4/4), t6030-pmp-graph (27/27), t6030-pmp-supplier, apple-dart-tlb-stall --dtc, display26, j613-mtp-s2idle pass.
  • At 731c7e362763 (merge aa90ecc72b77 of main 5a13ea7b4b52), W=1 with clang 23.1.3 and gcc 16.2.0: apple-dart.o, pcie-apple.o, sleep.o (with its KUnit tests), atc.o, macsmc.o, pmgr-pwrstate.o, spmi-apple-controller.o and pmp-export.o build with no compiler warning. atc.c has 74 kernel-doc notes, the same number as main. pmp-export.o was built with -DCONFIG_APPLE_PMP=1, as the build had no Rust. The KUnit tests were compiled, not run.
  • The J516s and J514s DTBs build with W=1. The sources t6030.dtsi and t6030-j516s.dts are the same files as at f66d67e3a242.
  • Host tests (tools/asahi/run-host-tests.py --only) on the same tree: sleep 53/53, dart 33/33, pcie 9/9, pmgr 3/3, t8132 6/6, atc 18/18, j613 9/9, macsmc 1/1, display26 1/1, t6030 13/14. The one is t6030-pmp-dt-tests, which failed only because fdtget was not installed; run by hand with fdtget it passes for both boards, with the PR's device tree and with main's.
  • Not a fixed A/B: the two J516s idle readings taken with this head were 5.52 W (boot A) and 5.73 W (boot B). Another kernel, main cff875630c61, read 10.16 to 10.95 W on the same Stage 2. That main is not an ancestor of this head and no raw log was kept, so this does not show that the probe writes lower idle power.

…r blocks

Allow the optional phy-shared, phy-ip, clkgen, axi2af, cio3pll,
phy-common, and port/phy/intr2axi register windows on Apple PCIe host
nodes so the T6030 sleep provider can map them by name from DT.

Signed-off-by: Diljit Singh <hey@djdev.me>
Add the Devicetree schema for the Apple T6030 (M3 Pro) system
suspend-to-RAM controller, including its 33 register windows, phandle
links, wake sources, SMC sleep policy timing, and register sequence
opcodes (including explicit slc-off and clear64-way opcodes).

Signed-off-by: Diljit Singh <hey@djdev.me>
Add T6030 match data enabling keep_pending so masked SPMI sources owned
by the T6030 firmware sleep path are not acknowledged away at probe or
during unrelated IRQ handling. Bound consecutive unhandled held
interrupts across all IRQ words including the notification word to
prevent an interrupt storm if a masked bit ever asserts the parent line.

Signed-off-by: Diljit Singh <hey@djdev.me>
…leep

T6030 powers down ATC common domains during deep sleep, so set
common_pd_dropped in the T6030 PHY match data so the PHY driver
reinitializes its common block on wake.

Signed-off-by: Diljit Singh <hey@djdev.me>
Allow sleep providers that supply apple,smc-sleep-policy in DT to drive
the generic macsmc sleep sequence (pmVC, SLPA, AP idle, and wake
notices) and expose until_before_slpa() so providers can pace hardware
votes ahead of the SLPA deadline without duplicating SMC state.

Signed-off-by: Diljit Singh <hey@djdev.me>
Export apple_dart_set_pmp_sleep() (guarded with IS_REACHABLE) so the
PMP driver can mark its DART as sleep-managed. Keep TLB and PM suspend/
resume callbacks gated if the PMP DART fails to come back on wake so
subsequent operations do not fault on an unpowered DART.

Signed-off-by: Diljit Singh <hey@djdev.me>
Register the T6030 PMP DART with apple_dart_set_pmp_sleep() when
apple_pmp_commit_available() binds the commit callback on the first
apple_pmp_suspend_late() (with apple,t6030-pmp-v2 instantiated on
J516s via the runtime overlay t6030-j516s-pmp.dtso), so apple-dart
coordinates its suspend/resume gating across deep sleep.

Also move the wake_err check in apple_pmp_resume_early() ahead of
clearing pmp_commit_used and apple_sleep_coproc_set_ready() so the
coprocessor stays stopped and its RX mailbox held until a real wake
restores power.

Signed-off-by: Diljit Singh <hey@djdev.me>
Add the generic sleep-core hooks needed by the T6030 provider:
- apple_sleep_domain_kept() via soc->ops->domain_kept, checked in
  pmgr-pwrstate suspend so wake resync still restores genpd-OFF domains;
- after_early, wfi_again, and before_enclave hooks (marking regs_staged
  before before_enclave so refusal cleanup always runs undo_regs);
- gate_fail_closed, cpu_start_every_cluster, gp_host_apart, and
  failed_stop_ends_sleep profile flags;
- split sleep_ps_rewake() into staged helpers for multi-stage wake
  ordering.

Signed-off-by: Diljit Singh <hey@djdev.me>
Consult apple_sleep_domain_kept() during system sleep power-off so
power domains managed directly by the SoC sleep provider are not gated
early by genpd suspend while wake resync still restores genpd-OFF
domains.

Signed-off-by: Diljit Singh <hey@djdev.me>
Add the Apple T6030 (M3 Pro) deep suspend-to-RAM provider for
apple-sleep with full SEP stop, DT-driven entry/wake register
sequences (with explicit slc-off and clear64-way opcodes), PTD/CPM/SLC
handshakes, GP PCIe PHY/clock park and wake recovery, PMU RTC alarm
re-arming and sleep/wake stage byte updates (writing 0xfe to PMU
register 0xf801 on wake, matching the 0x50 stage byte written at sleep
entry), and KUnit coverage.

Signed-off-by: Diljit Singh <hey@djdev.me>
Add the apple,t6030-sleep controller node with its register windows,
phandle links, wake sources, SMC policy, and explicit entry/wake
register sequences in t6030.dtsi, add the PCIe sleep register windows,
and enable deep sleep on J516s.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr
DjDeveloperr requested review from a team as code owners December 3, 2026 05:37
@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) area:power Area from CODEOWNERS (bot) area:usb Area from CODEOWNERS (bot) blast:m3 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Merge readiness at 731c7e36: not ready yet

Check Detail
CI at head running running: KUnit dcp-topology macsmc pmgr-pwrstate apple-dart, KUnit jpeg asahi
Review no approved by sithglan, 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 731c7e36
Conflicts ok none
PR text ok Risk: two-way · a plain revert restores the old behaviour · J516s on 27.2 mainly. Shared code reached by other Macs: the SMC, SPMI, DART, PMP and PMGR hooks, and apple-sleep itself. Most of it is gated by SoC data or a device tree property. Not gated: the reworked power-domain wake-order loop in sleep.c. The late PCIe resume path came to main with #3809, which has its own rows: J414s, J516s and J714s. J514s gets the T6030 PCIe and ATC matches and no sleep node.

Areas: area:gpu, area:platform, area:power, area:usb

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: MERGE at f027342

Checked: The superseded I2C6 table is absent from all 11 commits. Seventeen changed paths match the reviewed tip of #3818 byte for byte, and the five shared paths match the clean three-way merge onto the stated main base. Both binding documents passed validation. All four PMP DT builds and the 13-slot quiesce check passed, and the quiesce negative control was caught.

Follow-ups: Please split further changes to this provider into smaller reviewable PRs.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Pre-qualification check for the two items flagged by @satchlj on #3818 and the #4037 T8122 deep-sleep lessons across #4067 / #3809 / #3763:

1. Pre-cycle-1 checks (sleep-t6030.h & J516s RTC)

  • t6030_sleep_post_timer() (SPMI_NOTIFY_ENABLE): mask = s->soc->spmi_notify_sleep & ~T6030_SPMI_DONE (0x2000000) clears only BIT(0) (T6030_SPMI_DONE, the AP command-completion status bit polled by t6030_pmu_xfer()) while keeping BIT(25) (PMU peripheral wake notification) enabled. No further AP SPMI transfers run between t6030_sleep_post_timer() and WFI, NUB.SPMI0.SW3 wake delivery stays armed, and t6030_sleep_wake() unconditionally restores t6030.notify_saved[1] on wake.
  • RTC device on J516s: Live J516s exposes a single RTC device (/dev/rtc0, macsmc-rtc; no /dev/rtc1). In t6030.dtsi, apple,smc-rtc points its nvmem-cells directly at pmic1: pmic@b (usid 0xb) registers 0x2000 (rtc_ctrl), 0x2008 (rtc_alarm), and 0x200e (rtc_alarm_mask) with interrupts-extended = <&nub_spmi 2 IRQ_TYPE_EDGE_RISING>, so rtcwake -d /dev/rtc0 -m mem -s <N> programs the usid 0xb SPMI PMU alarm that t6030_alarm_snapshot() and t6030_sleep_post_timer() manage.

2. #4037 lessons across #4067, #3809, and #3763

#4067 is rebased on main (bbb91e2a416d), which already includes merged #4037 (1dd48899bb34):

  • Firmware-27 internal DCP stop — IN: apple_dcp_hw_t6030 sets .v27_early_stop = true and .s2r_layout = &dcp_s2r_t6030, with J516s supplying the firmware-27.2 apple,sleep-*-args properties in t6030-j516s.dts. #3809 covers T6030 PCIe port DART restoration before noirq retraining, and #3763 covers hci_bcm4377 boot-ROM resume verification.
  • dcpext s2r_ext handoff — NOT IN (deferred until T6030 external display is enabled): apple_dcp_hw_t6030_dcpext intentionally omits .s2r_ext / .s2r_layout for now because dcpext0/dcpext1 stay disabled and powered off on default J516s (skip_disp + !sleep_ps_on()). When T6030 external display support is enabled on firmware 27.2, apple_dcp_hw_t6030_dcpext will need the same firmware-27 s2r_ext + apple_dart_display_streams_saved() wiring from #4037 so t6030_gate_coprocs[] (DISPEXT0_CPU / DISPEXT1_CPU, must_stop = true) sees them stopped cleanly.
  • PMP ack and disp-off ordering — IN: t6030_sleep_display_off() performs only reversible power-state staging (t6030_ps_at_display_off() / t6030_ps_undo_display_off()), while t6030_quiesce_at_display_off() runs in t6030_sleep_prepare_regs() past the refuse_late=1 abort boundary; .wdt_wd1 = true is set; PMP DART gating across failed wakes (1b0cf437881c / 90f1d7103656) is in; and #4037's merged pmp-report.c / sleep.c second-pass coprocessor domain checks are inherited directly from main.
  • Stray domains / .coproc_slp_ddr / SIO_CPU ordering — IN: t6030_sleep_soc leaves .coproc_slp_ddr unset (false) so adopted MTP keeps DRAM-off deep sleep, does not list SIO_CPU in .stray, and lowers T6030_PS_SIO_CPU in t6030_sleep_after_early() after pass-1 apple_sleep_coprocs_stop(s, false) stops SIO.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J516s (T6030, M3 Pro) deep-sleep receipts:

1. Combined qualification (63e5785fcf14, 7.3.0-m3-s2r-g63e5785fcf14, boot_id=b96545e6-2c19-418d-a748-73699b09b98f) — PASS (3/3 committed deep-sleep cycles + refuse_late=1)

  • PR heads inside: #4067 (f0273427aece — identical drivers/soc/apple/*, arch/arm64/boot/dts/apple/t6030*, drivers/pmdomain/*, drivers/pinctrl/*, drivers/gpu/drm/apple/* except 3 KUnit test files) + #3809 (173d1f2d1b58) + #3763 (c5949ba1ab2d) + #4037 (merged 1dd48899bb34).
  • git diff --stat 63e5785fcf14 f0273427aece (44 files): on J516s runtime paths, the only differences are #3809 (drivers/pci/controller/pcie-apple.c, drivers/iommu/apple-dart.c, include/linux/soc/apple/dart.h), #3763 (drivers/bluetooth/hci_bcm4377.c), and merged #3949 (drivers/thermal/apple-pmp-thermal.c); the rest are T8122/T8132/G17/ANE/KUnit/host-test files not active in T6030 sleep.
  • Cycles in one boot (mem_sleep=s2idle [deep]):
    1. refuse_late=1 dry-run (05:53:39Z -> 05:53:43Z): refused cleanly (fail 0 -> 1, last_failed_errno=-16); display, GPU, NVMe, Wi-Fi, and BT stayed live.
    2. Cycle 1 (rtcwake -d /dev/rtc0 -m mem -s 15, 05:53:43Z -> 05:54:05Z): PASS (suspend_stats success 1 -> 2, GPU firmware back in 3972 us, hci_bcm4377 ROM reset + BD_ADDR 60:3e:5f:4a:e8:c8 restored).
    3. Cycle 2 (rtcwake -d /dev/rtc0 -m mem -s 15, 05:54:05Z -> 05:54:27Z): PASS (suspend_stats success 2 -> 3, GPU firmware back in 4824 us, hci_bcm4377 ROM reset + BD_ADDR restored).
    4. Cycle 3 (rtcwake -d /dev/rtc0 -m mem -s 185, 05:54:27Z -> 05:57:39Z): PASS (suspend_stats success 3 -> 4, fail unchanged at 1, V27 wake ... plain-on 0@84, apple_sep back, GPU firmware back in 4902 us, hci_bcm4377 post-sleep before reset: bootstage 2, RTI 2 -> after reset: bootstage 0, RTI 0 + BD_ADDR restored, WDT paused across >180 s power-off).
  • Post-wake parity: eDP-1 connected/enabled, Wi-Fi wld0 UP, BT hci0 60:3E:5F:4A:E8:C8 powered, PCIe (00:00.0, 00:01.0, BCM4388 WLAN+BT, GL9755), NVMe, USB-C partners, and aurora-g16 (failed 0 errno 0 degraded 0, sensor_errors 0) all intact; 0 SError/BUG/WARNING.

2. Standalone exact head (f0273427aece, 7.3.0-m3-s2r-gf0273427aece, boot_id=3ed489fe-b624-4584-a16b-6b5096eeb3ce, without #3809 or #3763) — Cycle 1 hang

  • Entered Cycle 1 (rtcwake -d /dev/rtc0 -m mem -s 15 at 06:05:12Z, wake 06:05:28Z) and did not return to userspace (journal ended at 06:05:11Z); recovered via remote reset and restored stock kernel/boot.bin.
  • Next isolation test (f0273427aece + #3809 173d1f2d1b58 without #3763, 2 committed cycles) is building now to confirm the #3809 merge-order dependency before #4067.

@github-actions github-actions Bot added blast:m1 Macs affected, from Merge risk (bot) blast:m2 Macs affected, from Merge risk (bot) and removed needs-template PR body lacks Tested or Risk (bot) labels Dec 3, 2026
#3809 is in main now, and #4176 added apple_dart_clear_host_resumes() and
apple_dart_host_restart() to main. Both sides add the same
apple_dart_clear_host_resumes(); keep one copy, and
apple_dart_is_host_resumed() from this branch, in
include/linux/soc/apple/dart.h and drivers/iommu/apple-dart.c.

Signed-off-by: DjDeveloperr <hey@djdev.me>
apple_sleep_undescribed() came to main while the T6030 provider was in
review. It makes s2idle the default when a SoC with no regions has an ANS
and no PCIe tables for it, as every deep sleep would be refused there.
T6030 has no such tables and apple_sleep_refuse() asks for them only when
ANS is off (gp_host_apart), so its deep sleep would go through and still
not be the default. Ask for the tables with the same condition.

Other SoCs don't set gp_host_apart.

Signed-off-by: DjDeveloperr <hey@djdev.me>
@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) and removed ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) labels Dec 3, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Merged main (5a13ea7b4b52, with #3809) into this branch as aa90ecc72b77, and added one small commit, 731c7e362763. Please look at the merge and that commit and approve again; the push dismissed the approval at f66d67e3a242.

The merge. The text conflict was only in include/linux/soc/apple/dart.h and drivers/iommu/apple-dart.c: both sides add the same apple_dart_clear_host_resumes(). One copy stays, next to this PR's apple_dart_is_host_resumed() and main's apple_dart_host_restart(). No line of the resolution is new, and both files come out the same as at f66d67e3a242.

Compared with "main plus this PR's diff at f66d67e3a242", four files differ:

Compared with f66d67e3a242: 23 of the 28 files of the PR are the same files, with both device trees, sleep-t6030.h, sleep-t6030-pcie-wake.h, sleep-t6030-ps.h, sleep-t6030-quiesce.h, macsmc.c, pmgr-pwrstate.c, spmi-apple-controller.c and pmp-export.c among them. The other five got main's changes: apple,pcie.yaml, pcie-apple.c (#4176, all behind the T8132 flag), atc.c, run-host-tests.py and sleep.c.

The new commit. This one is not in the approved code. main got apple_sleep_undescribed(), which makes s2idle the default when a SoC without regions has an ANS and no PCIe tables for it. T6030 matches that, so after a plain merge J516s would still offer deep sleep, but no longer by default. apple_sleep_refuse() asks for those tables on T6030 only when ANS is off (gp_host_apart), so the new commit leaves T6030 out of that check. No other SoC sets gp_host_apart.

Checks on the result: W=1 objects of the eight touched drivers with clang and gcc, without a compiler warning; both T6030 DTBs; host tests sleep 53/53, dart 33/33, pcie 9/9, pmgr 3/3, t6030 13/14 plus t6030-pmp-dt-tests by hand (it only missed fdtget; with it, it passes here and on main's device tree); checkpatch --strict on the new commit is clean. Not booted: the J516s row is from f66d67e3a242, and a short J516s check (deep is the default, one deep sleep) is listed under "Not yet".

DjDeveloperr pushed this, so a DjDeveloperr approval does not count for the last-push rule. RyanTheTide, erikwb or any other maintainer can approve.

@github-actions github-actions Bot removed blast:m1 Macs affected, from Merge risk (bot) blast:m2 Macs affected, from Merge risk (bot) labels Dec 3, 2026

@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 731c7e3 (code).

Checked: The ANS tunables are no longer treated as unconditionally missing at probe for the split GP-host provider. The runtime refusal still checks an inactive ANS link for those tunables. I compiled the exact predicates and checked five cases, including the live-ANS route, the missing restoration data refusal, and the unchanged legacy path. The DART implementation and header match the previously reviewed f66d67e blobs, with one host-resume clear helper. The PCIe controller matches main after #3809, and the J516s DT blob matches the preceding head. All three changed binding documents validated. The published hardware result applies to f66d67e.

@DjDeveloperr

DjDeveloperr commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor Author

J516s (MacBook Pro 16-inch, M3 Pro, T6030, OS firmware 27.2 / 26B123) deep-sleep row at exact head 731c7e36276370bdbf4bb6fbf400ac9ee37a6351: PASS (36/36).

  • What: Exact PR head 731c7e36276370bdbf4bb6fbf400ac9ee37a6351 (7.3.0-pr4067, merged onto main) booted with the matching J516s device tree (sleep-controller@3642d4000 enabled, Stage 1 1.0.0b17-gf52d8324, Stage 2 1.0.0b17-g683a128b).
  • Tested: Boot probe and /sys/power/mem_sleep, 1 committed deep sleep cycle (rtcwake -m mem -s 20), pre/post Wi-Fi gateway reachability, PCIe endpoint inventory and driver bindings, NVMe direct 256 MiB read + 64 MiB write/verify, GPU pixel-checked rendering and recovery counters, battery/AC, 24 thermal sensors, internal display, USB-C PD controllers, and kernel log errors/warnings against the prior f66d67e3 baseline boots.
  • Result:
    • Probe & default: apple-sleep 3642d4000.sleep-controller: deep sleep is the default: boot object resumes 0; mem_sleep = s2idle [deep] before and after; 0 missing parts at probe.
    • Deep sleep: rtcwake rc 0, slept 21 s, same boot, entry (deep) 1 / s2idle 0 / exit 1, back from sleep, boot object resumes 0 -> 1, suspend_stats success 0 -> 1 / fail 0 -> 0, wake source: NUB.SPMI0.SW3, 0 refusals.
    • Post-wake subsystems: Wi-Fi (wld0) gateway ping restored in 7 s; all 5 PCIe endpoints unchanged (0 ffff, brcmfmac / hci_bcm4377 / sdhci-pci still bound); NVMe read + 64 MiB write-verify rc 0 before and after; GPU renders rc 0 with 0 recoveries (health: failed 0 errno 0 degraded 0) before and after; battery (Full 100%, AC online), 24 thermal sensors (30.5–50.6 C), internal display (connected enabled), and all USB-C controllers intact.
    • Logs: 0 WARN/BUG/Oops/SError, taint unchanged (4 -> 4), 0 PCIe AER/timeouts, 0 DART faults, 0 new error lines against the f66d67e3 baseline boots.
    • One new warning (not judged, not in the f66d67e3 baseline): phy-apple-atc b03000000.phy: power domain went off under an active USB4 link at 73.24 s on wake.
    • Watchdog judge note: the initial judge marked the watchdog line FAIL only because CONFIG_WATCHDOG_SYSFS is off (so /sys/class/watchdog/watchdog0/state is absent). The captured boot log confirms the 1 min hardware watchdog was active (Using hardware watchdog /dev/watchdog0: 'Apple SoC Watchdog', version 0. and Watchdog running with a hardware timeout of 1min., with RuntimeWatchdogUSec=1min), and the fixed judge (428949406dbd) re-judges the recorded run at 36/36 PASS.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Dec 3, 2026

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

Verdict: MERGE at 731c7e36276370bdbf4bb6fbf400ac9ee37a6351

Blockers: none

Checked:

  • Re-reviewed the delta since Ryan's approved f66d67e3a242:
    • Merge aa90ecc72b77 (main 5a13ea7b4b52): clean deduplication of apple_dart_clear_host_resumes() in drivers/iommu/apple-dart.c and include/linux/soc/apple/dart.h, keeping apple_dart_is_host_resumed() (and its !CONFIG_IOMMU_APPLE_DART inline stub) alongside apple_dart_host_restart().
    • New commit 731c7e362763 (drivers/soc/apple/sleep.c): adding !s->soc->gp_host_apart to apple_sleep_undescribed() matches the existing gp_host_apart branch in apple_sleep_refuse() (which only requires apcie_phy_tunable when ANS is powered off) and is strictly T6030-scoped (no other SoC sets gp_host_apart).
  • Verified exact-head J516s (T6030, fw 27.2) deep-sleep row is in and PASS (36/36), and apple-build, dt-checks, host-tests, source, DWC3/ATC, readiness, and pr-text are green.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Landing check for head 731c7e3, merged locally onto main 9e6409d (merge base 5a13ea7). The merge is clean. Main has since moved to a7e09cb (#4205), which only changes DCP selftests, so nothing overlaps with this PR. The only file both this PR and main changed after 5a13ea7 is tools/asahi/run-host-tests.py, and it merged cleanly.

Checks run on Mini against the merge tree, limited to the code this PR touches:

  • W=1, arm64, LLVM, aurora_defconfig with the KUnit tests on (macsmc, pmgr-pwrstate, apple-dart, soc sleep, atc). The 7 changed .c objects (apple-dart, macsmc, atc, pmgr-pwrstate, pmp-export, sleep, spmi-apple-controller) build with 0 warnings. pmp-export.o was built with -DCONFIG_APPLE_PMP=1 because APPLE_PMP needs RUST and RUST was off in this config.
  • KUnit pmgr-pwrstate on UML (ARCH_APPLE swapped for COMPILE_TEST + OF): 37/37 passed.
  • KUnit macsmc and apple-dart: built with their tests included, not run. They need arm64 QEMU: macsmc uses the arm64 counter, and apple-dart won't run on UML.
  • make dt_binding_check DT_SCHEMA_FILES=pci/apple,pcie.yaml:soc/apple/apple,t6030-sleep.yaml:spmi/apple,spmi.yaml: clean.
  • CHECK_DTBS on every t6030/t6031/t6032 board: the same 137 warning lines on main and on the merge. This PR adds no new warnings.
  • Host tests in aurora-linux-host-tests:ubuntu2404, picked as every test that reads a file this PR changes, including t6030-sleep-qblk, apple-dart-tlb-stall, display26, j613-mtp-s2idle and apple/pmgr-inherited: 70/70 passed. 2 of the --ref controls passed only after their old commits were fetched. The t6030/dart/display subset was run again after main picked up the ANE DT change: 24/24 passed.

Reviews at 731c7e3: aurora-silicon-review and sithglan approved. The earlier review is dismissed, and nobody has requested changes. Hardware: M3 J516s Arm B (this PR + #3653) had 35 passes, 0 failures and 1 incomplete run (an empty baseline lookup). The J516s deep-sleep row at 731c7e3 passed 36/36.

The only remaining block is the last-push approval rule, so this is an admin merge at the exact head.

@DjDeveloperr
DjDeveloperr merged commit 49d5220 into main Dec 3, 2026
21 of 22 checks passed
@DjDeveloperr
DjDeveloperr deleted the feat/t6030-sleep-provider-v3 branch December 3, 2026 15:37
DjDeveloperr added a commit that referenced this pull request Dec 3, 2026
Main gained the T6030 sleep profile (#4067) at the same places this
branch adds T6020: keep both includes and both match-table entries in
sleep.c, and both compatibles in sleep-test.c's profile list.

Signed-off-by: DjDeveloperr <hey@djdev.me>
DjDeveloperr added a commit that referenced this pull request Dec 3, 2026
Bring the branch up to main, which now has #4067: the T6030 sleep
controller and the J516s sleep wiring. Nothing on this branch repeats
it. #4067 put the J516s wiring in t6030-j516s.dts, and this branch only
touches t6030-j514s.dts.

Signed-off-by: DjDeveloperr <hey@djdev.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) area:power Area from CODEOWNERS (bot) area:usb Area from CODEOWNERS (bot) blast:m3 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