Skip to content

arm64: spin table: release chosen stopped CPUs ahead of the others - #2118

Merged
DjDeveloperr merged 1 commit into
integration/aurorafrom
j716c/spin-table-release-cpus
Nov 17, 2026
Merged

DjDeveloperr merged 1 commit into
integration/aurorafrom
j716c/spin-table-release-cpus

Conversation

@erikwb

@erikwb erikwb commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What this does

At a suspend's commit the parked spin-table CPUs stop and wait, still running and coherent,
until spin_table_release_stopped() lets all of them take their last WFI together.

This adds spin_table_release_cpus(const struct cpumask *), which releases the stopped CPUs of a
mask now, ahead of the others; the rest still wait for spin_table_release_stopped(). The mask is
cleared by spin_table_stop_finished(). There is a stub for kernels without CPU hotplug.

The T6050 sleep uses it on the J716c to take its two secondary CPU clusters down before the boot
cluster (#2119 (j716c/sleep-j716c-profile)). Nothing else calls it, so other platforms are unchanged.

Tested

  • arm64: spin table: release chosen stopped CPUs ahead of the others #2118 (j716c/spin-table-release-cpus) builds on its own base (Image.gz, modules and dtbs, arm64, LLVM).
  • All 17 branches merged on integration/aurora were 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 #2118 (j716c/spin-table-release-cpus). Based on integration/aurora; no dependencies at build time.

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

At a suspend's commit the parked CPUs stop and wait, still running and
coherent, until spin_table_release_stopped() lets all of them take their
last WFI together.

A platform's sleep may need some of them down before the rest: the
sleep engine on the Apple T6050 runs each CPU cluster's power-down in
turn, and a cluster only goes down once all of its cores are in their
last WFI. Add spin_table_release_cpus(), which releases the stopped CPUs
of a mask now; the others still wait for spin_table_release_stopped().
The mask is cleared again by spin_table_stop_finished().

Developed with Claude Code.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb
erikwb force-pushed the j716c/spin-table-release-cpus branch from 3abd1e1 to d127243 Compare November 17, 2026 15:08
@DjDeveloperr
DjDeveloperr marked this pull request as ready for review November 17, 2026 19:02
@DjDeveloperr
DjDeveloperr merged commit 3eba535 into integration/aurora Nov 17, 2026
1 check passed
@RyanTheTide
RyanTheTide deleted the j716c/spin-table-release-cpus branch November 17, 2026 23:53
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.

2 participants