Repository navigation
soc: apple: sleep: T6050: J716c (M5 Max) deep sleep - #2119
Merged
Merged
Conversation
… buses The M5 Max J716c uses the T6050 sleep controller too. Add its compatible, apple,t6050-j716c-sleep, with apple,t6050-sleep as the fallback. The M5 Max has two SPMI buses beyond the J714s's five (nub-spmi1 and nub-spmi4): allow up to seven in apple,spmi-buses and apple,spmi-sleep-order, after the J714s's five, so that the first five keep their register-sequence block indices (8 to 12) and the two new ones take 13 and 14. Developed with Claude Code. Signed-off-by: Erik Bourget <erik@ebourget.net>
Keep the Max power-domain inventory distinct and refuse incomplete profiles before hardware preparation. Validate board and CPU topology before applying boot register sequences. The J716c entry callbacks remain unavailable pending qualification of its memory-controller transitions. Developed with Claude Code. Signed-off-by: Erik Bourget <erik@ebourget.net>
The J716c's apple,t6050-j716c-sleep profile was inventory only and refused at the probe. Give it the J714s's entry and wake on the M5 Max: the same operations, gate list, SMC policy, CPU layout and display words, over the Max's power inventory (the Pro's words at the same indices, then the second encoder's and AMCC16-31's), with the keepalive tables of the Pro's geometry, which the Max's PMGR has too. Its map first checks the PMGR banks and the display slots against the J716c's addresses, and then maps as on the J714s. The Max-only power words are in none of the lists the entry lowers: saved at the entry, and put back at the wake if they dropped. The paths that served the J714s's profile only (the storage controller's late stop and wake, the display coprocessors' power readiness and their restart's power words, the firmware 27 late scope) now serve both full T6050 profiles. No PMP runs on this board and its report is disabled, so nothing else owns the PTD entries the commit drops: such a profile takes them without the report's ownership. The gate still refuses a PMP that runs unbound, and a board whose report is enabled still has the report give them up. The J714s's profile is unchanged, and an inventory profile with an unavailable reason still refuses. Developed with Claude Code. Signed-off-by: Erik Bourget <erik@ebourget.net>
The sleep sets every SPMI bus's interrupt mask to the sleep's response enables after ANS, and puts the run-time masks back at the wake. It had room for the J714s's five buses. The M5 Max has two more, nub-spmi1 and nub-spmi4, behind its other PMICs: take up to seven, after the J714s's five, so that their indices as register-sequence blocks (8 to 12) do not move. A DT with five buses, as the J714s's, works as before. Developed with Claude Code. Signed-off-by: Erik Bourget <erik@ebourget.net>
… before the boot cluster The T6050's CPU clusters' power-down programs run one at a time on one engine. On the J716c, with all three cluster requests dropped in the commit window, the P cluster's program queued behind the boot cluster's, which cannot finish while the boot core is still running the commit, and the sleep did not complete. For the J716c profile (clusters_down_first in its SoC data), take clusters 1 and 2 down at the very start of the commit, which is past every refusal: release their cores to their last WFI ahead of the boot cluster's (spin_table_release_cpus()), wait for all of them to be counted in t6050_cpu_down(), drop each cluster's PTD bit and request, and poll each cluster's sequencer until its program is done. The boot cluster then goes down last, as before, and all three programs complete. This is past the point of no return, so it refuses nothing. Its waits count the CPU's own counter, as timekeeping is stopped by then, and are bounded well inside the commit's runway: 2 ms for the cores, 5 ms for each sequencer. If not all cores are counted, the cluster requests are left up and the commit drops them later, as before. Any failure ends in the engine's watchdog reset 5 s after the commit, as it would without this step, so there is nothing to undo. Once the requests are dropped, nothing in the commit touches those clusters' blocks: their later request release and their CPM counter reads in the power-gate rounds are skipped. The results are kept in the region state and reported in one line after the wake. Developed with Claude Code. Signed-off-by: Erik Bourget <erik@ebourget.net>
On the J716c the first video encoder's system power word reads 0x0f0003ff (on, with no automatic state) at the commit, although no Linux driver uses it and every other media word of the GPU die is off or under automatic power. The entry's last phase waits for its power gate. For the J716c profile (lower_venc0 in its SoC data), lower VENC0_SYS at the entry, after AUSS, and poll it off. If it does not go off, the sleep is refused there, before anything irreversible. A refusal puts it back as it read before; after a sleep the snapshot's replay raises it again. Developed with Claude Code. Signed-off-by: Erik Bourget <erik@ebourget.net>
erikwb
force-pushed
the
j716c/spin-table-release-cpus
branch
from
November 17, 2026 15:08
3abd1e1 to
d127243
Compare
erikwb
force-pushed
the
j716c/sleep-j716c-profile
branch
from
November 17, 2026 15:08
cc10822 to
949b24a
Compare
…f CPU The early cluster sequence counts present cluster-1 and cluster-2 CPUs as they execute the final CPU-off callback. A CPU tracked as off after a failed restart passes the spin-table held check but cannot reach that callback again. Reject the inconsistent cohort while the final sleep checks can still return. Preserve the treatment of offline CPUs that really are parked, and do not change the spin-table masks. Signed-off-by: Diljit Singh <hey@djdev.me>
DjDeveloperr
changed the base branch from
j716c/spin-table-release-cpus
to
integration/aurora
November 17, 2026 19:06
DjDeveloperr
marked this pull request as ready for review
November 17, 2026 19:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Deep sleep (suspend-to-RAM) for the 16" M5 Max MacBook Pro (J716c) in the T6050 sleep driver.
apple,t6050-j716c-sleepcompatible (withapple,t6050-sleepasfallback), and up to seven SPMI buses (the Max's nub-spmi1 and nub-spmi4 after the J714s's
five).
checked before any hardware is touched, with the board and CPU topology validated first.
apple,t6050-j716c-sleep): the J714s's entry and wake over the Max'sinventory, with the Max's own power words saved at the entry and put back at the wake, and its
banks and display slots checked against the J716c's addresses before anything is mapped. The
paths that served the J714s only (the storage controller's late stop and wake, the display
coprocessors' power readiness and restart power words, the firmware 27 late scope) serve both
full T6050 profiles. No PMP runs on this board, so the commit takes the PTD entries itself.
commit, before the boot cluster: their cores are released to their last WFI first
(
spin_table_release_cpus()), counted, their requests dropped and their sequencers polleddone. The clusters' power-down programs run one at a time; dropped together, the P cluster's
queued behind the boot cluster's, which can't finish while the boot core runs the commit. This
is past the point of no return and refuses nothing: its waits are bounded on the CPU's counter
(2 ms for the cores, 5 ms for each sequencer), and if not all cores are counted the cluster
requests are left for the commit to drop as before. Any failure ends in the engine's watchdog
reset 5 s after the commit, as without this step. The result is logged in one line after the
wake.
the sleep is refused there, and a refusal puts it back.
The J714s's profile is unchanged.
Tested
j716c/sleep-j716c-profile) builds on its own base (Image.gz, modules and dtbs, arm64, LLVM).drivers/soc/apple/sleep-test.ccover the J716c inventory and the full profile (built; not run separately on hardware).integration/aurorawere built as one kernel and run on a J716c (16" M5 Max): one suspend-to-RAM with a USB4 dock attached, about 30 s asleep, woken by the RTC alarm (wake source 76). After the wake all 18 CPUs were online, the dock's router came back in place with its Ethernet up, and the SEP answered RNG reads. The sleep's log showed "secondary clusters down first: cores 6+6, cluster 1 0x1a in 353 us, cluster 2 0x1c01a in 448 us". The PMP was not running in that build.Dependencies
Branch #2119 (
j716c/sleep-j716c-profile). Stacked on #2118 (j716c/spin-table-release-cpus).Part of the J716c deep sleep set: #2118 (
j716c/spin-table-release-cpus), #2119 (j716c/sleep-j716c-profile), #2120 (j716c/sleep-wake-source-names), #2121 (j716c/sleep-sep-auto-wake), #2122 (j716c/sep-t6050-profile), #2123 (j716c/dts-deep-sleep), #2124 (j716c/drm-apple-sleep), #2125 (j716c/dart-sleep), #2126 (j716c/thunderbolt-sleep), #2127 (j716c/usb-sleep), #2128 (j716c/phy-sleep), #2129 (j716c/pcie-sleep), #2130 (j716c/aic-sleep), #2131 (j716c/asahi-sleep), #2132 (j716c/spmi-sleep), #2133 (j716c/macsmc-sleep), #2134 (j716c/nvme-sleep).🤖 Generated with Claude Code