Repository navigation
soc: apple: J613 (T8122) suspend-to-RAM on the shared T8142 sleep framework (draft: wake unshown) - #2572
soc: apple: J613 (T8122) suspend-to-RAM on the shared T8142 sleep framework (draft: wake unshown)#2572satchlj wants to merge 9 commits into
Conversation
c1fda5b to
6da1c0e
Compare
6da1c0e to
4820c62
Compare
|
This series adds thirteen "J613 trial" module parameters in drivers/soc/apple/sleep-t8122.h (t8122_wdt_secs, t8122_match, t8122_atc_off, t8122_disp_off, t8122_wake_mask, t8122_quiet, t8122_console and others), j613_wktp2 in macsmc.c and untested_hold in sleep.c, all of which change what the sleep entry does or hold the machine for an external reset. A suspend path has to have one fixed sequence that works with no parameters: settle which watchdog, display, ATC and wake-mask steps are needed, apply them from the DT description, and remove the knobs. Diagnostic register dumps belong in debugfs, and the debug-cable witness and hold modes should not be in the driver. Until then this should stay a draft. |
|
Claude Opus 5.5 on @satchlj's behalf. This answers the J615 questions and Ryan's review. Everything below comes from our own J613 Linux trials and Aura (hypervisor) captures of macOS. Run and kernel numbers are the ones in our trial log. (a) Where J613 stands The SoC still keeps its power after Linux's commit. Every WD1 witness bites. Five things are now established:
A J615 row that would help: boot the branch below with (b) Trial branch
Ryan's review Agreed: a suspend path needs one fixed sequence and no parameters. The parameters stay only while we find which steps the hardware needs. Once a J613 sleep wakes, the needed steps become fixed and follow the DT. The rest goes: the diagnostic dumps move to debugfs, and the witness and hold modes leave the driver. Until then this stays a draft. |
|
J615 (MacBook Air 15-inch, M3, T8122; DCP and the rest on the 27.2 images) rows on The six gates are off on J615 too. With Bits 1, 2, 4, 5, 6 and 7 are never set, the same as your J613 Linux. One difference worth knowing: this J615 never starts the PMP at all (the Entry and commit.
Two fixes the J615 needed, on branch
The J615 is free for your next hypothesis (n62, Rows and setup
|
|
Follow-up from the J615: Linux can start the J615's halted PMP. A lab module asks for it the way a consumer would; on 27.2 the GPU, its consumer, is unbound, so nothing else starts it. The start went through ( |
|
J615, A J615-side note for anyone trying deep sleep here: with |
|
J615, |
|
More J615 rows on the six-gate lead. These are register reads on the production kernel through /dev/mem, plus two one-shot boots of the trial kernel. Data: 1. Linux can't write the gate banks at all, so "bit 30 doesn't stick" is the whole bank. I wrote 2. Bit 30 follows a domain's live power-gated state. I sampled once a second with nothing else touching the PMGR:
Active blocks also always read 3. That puts the gate names in doubt. AVD_SYS isn't in the ADT 4. PMP start requests don't arm them (R6b). I added PMP report entries for the DCS, AMCC, IOA0 and IOA1 soc-device records, always-on and no-ack, so the PMP started with 5. Request bits on T8122 are record indices, and the storage request sits on the wrong one. The unrequested ack bits 4-7 are the SOC_AON, SOC_REST, EACC0 and PACC0 records, which only makes sense if bits are records. The storage entry ( 6. Gate masks move between Linux boots without the PMP. The fleet kernel boot reads What I'd try next, and what I can run on the J615
|
|
Follow-up to point 5: the storage-request fix is #2682 (draft). On T8122 the display gate now marks |
|
One more J615 row, and it settles the naming question from point 3. Bank What fits better: the six are ordinary per-domain gates, set when their domain is power-gated, for six domains that macOS has gated at its commit and Linux still has powered. Your trial's own lists name exactly six such domains:
That count may be a coincidence; a ps-aon domain may not even have a gate in the main bank. But it's testable: watch bank (Side note for our fleet kernel: it keeps |
|
J615:
That leaves Separately: enabling L1 substates on the Apple internal PCIe port by capability looks like a plain power win for s2idle and runtime too. I'll hand that to our power lane with numbers rather than push it here. |
|
Correction to my last paragraph: no So on J615, at the hold, both PS words from your commit diff are at or below macOS's state: |
Signed-off-by: Satya Benson <satya@benson.earth>
The J613 port named the shared untested/untested_commit gates but its early-context entry reached neither of them, and it did not compile. - The early-context ops offered deep sleep whatever apple_sleep.deep said: they now use apple_sleep_valid, as the common ops do. - The early-context entry never stopped before the commit. It now stops right after the refusals, as the common entry does, having run the coprocessors' last checks and the SoC's final check: no core held, no power word written, nothing stopped. The switch is latched at .begin. - A dry run stopped J613's display coprocessor cold, with no restart. apple_sleep_dry_run() tells its driver, which then takes its ordinary suspend; the sleep driver doesn't count the running coprocessor in a dry run (display_no_restart). - Step notes went to PMU scratch at J815's offset, unmeasured on J613's PMU: no_pmu_notes. - A SoC that requires a wake source also requires its wake block. - The trial's reset watchdog is not armed over a dry run, and the empty commit_begin left from the panic stage is gone. - The shared match had a stray (*failed)++ on an int, and the header called three match helpers that don't exist: restored and made local. - The probe's dump of the common layout's words is skipped for a SoC with its own register map, whose offsets for them are all zero. The SMC's order is recorded as an open difference from macOS's and not changed: the only shared hook that defers the final notice behind the peer stops uses a transport never run on this SMC. Not built, not run. Signed-off-by: Satya Benson <satya@benson.earth>
… hold before commit The per-core FIQ quiet T8142 runs before its last WFI becomes a shared helper, which J613's trial can ask for (t8122_quiet). A J613 dry run can print the boot core's timer, PMU and deep-sleep registers (t8122_dry_regs, reads only). An untested SoC can run its whole entry and hold at the last step before the commit word (apple_sleep.untested_hold), for trials booted from RAM. The note on the SMC's order names the shared policy path that matches macOS's order and why it is not taken yet. Signed-off-by: Satya Benson <satya@benson.earth>
- dcp: the 26.6 firmware interface on an internal panel, with the sleep driver owning the coprocessor stops, selects the cold stop; drop the J613 board match. - asahi g17 sleep: map non-posted where the bus says so (IORESOURCE_MEM_NONPOSTED, from the DT's nonposted-mmio), not on the T8122 machine compatible. - macsmc: the opt-in WKTP=2 write needs no board match. The T8122 sleep data keeps .machine, the framework's board/CPU inventory check that T6050's J714s and J716c data use the same way. Signed-off-by: Satya Benson <satya@benson.earth>
4820c62 to
7f160c1
Compare
Conflict in apple_sleep_end(): keep integration's PMU wake hook and this branch's no-WD2 condition on the WD2 clear. Signed-off-by: Satya Benson <satya@benson.earth>
It was off by default behind a module parameter and never qualified on hardware; the default sleep path does not use it. Signed-off-by: Satya Benson <satya@benson.earth>
Drop .machine from the T8122 data so the controller's compatible alone selects it; the board/CPU inventory check no longer runs for it. Signed-off-by: Satya Benson <satya@benson.earth>
j613_sleep_down and dcp_j613_sleep_owned() describe a firmware-sleep cold stop, not a board: rename them sleep_cold_stopped and dcp_sleep_owned(). Signed-off-by: Satya Benson <satya@benson.earth>
|
Claude Opus 5.5 on @satchlj's behalf. Split: the gate-free part (T8122 data, DT node, Kconfig, KUnit, macsmc and asahi hooks, no module parameters, no board or firmware selection) is now #2746. This PR keeps the DCP 26.6 cold stop and the commit enablement as a draft until a real resume works on J613. |
|
Claude Opus 5.5 on @satchlj's behalf. J613 DT finding, the same one #2746 had: in this PR's |
|
Claude Opus 5.5 on @satchlj's behalf. J613 commit row on this stack (with #2583 and the current tip). Trial-only conditions: SEP disabled with its gate skipped by a local trial commit, an older trial DTB, RAM boot, disk read-only. So this is not evidence for this PR's real path.
|
macOS's commit on J613 shows the wake block's seven mask words at +0x08 and its status words from +0x24: every wake (RTC or keyboard) latches source 155 at +0x34, bit 27, which is status word 4 from +0x24. The match data had the status at +0x28, taken from T8140's layout, so a wake was read one word off. Use +0x24; the mask offset was already right. Signed-off-by: Satya Benson <satya@benson.earth>
|
Re-checked at eaf1225.
Assisted-by: LLM (Claude:Opus 5.5) |
|
Claude Opus 5.5 on @satchlj's behalf. SEP sleep on J613 works through this PR's enclave stop. On a trial dry run (SEP bound, link still up, a trial-only hook calling One thing to handle: after that stop, the dry run's refusal returned into resume with the SEP asleep, and the kernel took an |
|
J615, five deep commits on this stack (#2583 Step notes through the reset. On J615 the PMU scratch (ADT
What that says, for every row:
So on J615 what keeps the SoC up is after the commit word or outside the main PMGR words. The parked-CPU hold ( Row tools, raw notes and both boots' logs: kept on our side. The decoder maps the index bytes back to your |
Claude Opus 5.5 on @satchlj's behalf. Draft: J613 (M3 Air, T8122) has not woken from this deep sleep yet. It is opened so the work stacked on it has a base and can be reviewed, not to be merged.
What it is
J613's suspend-to-RAM support on the shared T8142 sleep framework:
drivers/soc/apple/sleep-t8122.h: T8122's sleep data and ops (power words, commit, coprocessor stops).sleep.c,sleep.hand Kconfig that keep J613's untested path off unless asked for, with a dry run that reads registers and a hold before the commit.The commits are the base of the J613 deep-sleep trial series. The first was written by Codex; the others are review fixes and the hardware selection above.
Status
8fd2d5e8, no trial commits; rebased ontoacfcd08bsince, range-diff=) on alba's arm64 build VM with the J613 trial kernel config: clean,Imagesha25673e577d0…. Not booted alone.nonposted-mmiomarks the resource (IORESOURCE_MEM_NONPOSTED), not on the T8122 machine compatible..machine = "apple,j613". That is the framework's board and CPU inventory check (boot core, core count), used the same way by T6050's J714s and J716c data.Stacked work
nvme-apple/t8122-sleep-idle) needs this sleep driver to call its last stop.0687f996mergesintegration/aurorainto this branch to clear the conflict without a force-push. Review the four commits below it; the merge's only resolved hunk is inapple_sleep_end(), which keeps integration's PMU wake hook and this branch's no-WD2 condition on the WD2 clear.Selection after
934b438c: the T8122 sleep data no longer carries.machine, so the controller's compatible selects it on every board with theapple,t8122-sleepnode int8122.dtsi: J433, J434, J504, J613 and J615. Tested on J613 only. The commit path itself stays behind the data'suntestedflag (apple_sleep.deep=1andapple_sleep.untested_commit=1), so on the default command line nothing changes on any of those boards.Still open: the DCP firmware-version gate (
fw_compat == DCP_FIRMWARE_V_26_6indcp_sleep_owned()). On J613 the internal DCP (28ec00000) advertises RTKit endpoint map parts0x11fand0x821fff(IOMFB0x37among them); a map from a firmware with a DCP sleep path is needed before an advertised endpoint can replace the version check.Draft, and stays draft until two gates are gone: the commit path still needs
apple_sleep.untested_commit=1(withapple_sleep.deep=1) and the DCP cold stop still selects on the firmware version. The bar is no gates on the default command line. Also not yet shown: that the SoC powers down after the commit on J613 at all (trial rows return only through the watchdog).Assisted-by: LLM (OpenAI:Codex, Anthropic:Claude Fable 5.2, Anthropic:Claude Opus 5.5)