Repository navigation
soc: apple: sleep: T8122: deep sleep by default on J613 - #3760
Conversation
The sleep driver keeps a SoC whose sleep data is derived behind two opt-ins: deep sleep is offered only with apple_sleep.deep=1, and every sleep stops before the commit unless apple_sleep.untested_commit=1. Whether a full sleep and wake works also depends on the firmware a machine runs, which the devicetree profile already describes, so let the node say when that machine has been through them. Signed-off-by: Satya Benson <satya@benson.earth>
…eep-tested On a SoC marked untested, a node with apple,sleep-tested gets deep sleep offered and as the default sleep state, and its sleeps commit, with no command-line parameter. It runs the same steps a sleep runs today with apple_sleep.deep=1 and apple_sleep.untested_commit=1. What derived data needs regardless of the opt-ins stays keyed on the SoC: the PMU step notes and the T8142 last-WFI stub and probe reports. A node without the property, including one from an older boot loader's devicetree, keeps today's behaviour. Signed-off-by: Satya Benson <satya@benson.earth>
The J613 on the 25G83 (26.6) firmware has been through repeated full deep sleeps and wakes on the T8122 sleep path: 15 of 15 with no reset, the GPU, audio clocks and display coprocessor back after each. Mark the sleep node apple,sleep-tested in that firmware profile, so deep sleep is the default and commits without apple_sleep.deep=1 or apple_sleep.untested_commit=1. The 27.2 profiles do not carry it: on the J615 with 27.2 firmware a committed sleep is still reset after the commit. Signed-off-by: Satya Benson <satya@benson.earth>
|
Conflict-only rebase onto current Old head: |
c1efd0c to
06284a2
Compare
Pulls in merged #3504 (M3 GPU firmware-driven deep sleep) and recent main commits. Signed-off-by: Satya Benson <satya@benson.earth>
|
Merged current |
|
Row:
Ready for review now that #3504 has merged and the exact-head default-command-line row is in. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Requesting changes at 574954eb4051. The mechanism is good. The board it's switched on for is the problem.
The code is fine. Without apple,sleep-tested, s->untested is exactly soc->untested, so every place that reads it keeps today's behaviour: apple_sleep_valid(), the mem_sleep default demotion in probe, dry_run in .begin, the stop in .enter and apple_sleep_dry(). Apart from where s->untested is set and the new log line, nothing reads soc->untested any more. The binding is a plain boolean under additionalProperties: false. A DT property is also how Ryan's no-board-gates rule wants this done. I wouldn't change anything in sleep.c or the yaml.
Blocker 1: scope is 27.2 only for the M3 Air. Ryan ruled on 12-02 that the 27.2-only rule applies per machine. Models already on the 27.2 stub, the M3 Air among them, get rows, merges and PR scope on 27.2 only. A 25G83 row doesn't count as proof for them, and a change that only matters on 25G83 is out of scope. J613's 27.2 board file is arch/arm64/boot/dts/apple/t8122-j613.dts. t8122-j613-25g83.dts is that file plus t8122-j613-dcp-25g83.dtsi. So:
-
drop the
&sleephunk fromt8122-j613-dcp-25g83.dtsi; -
put it at the end of
t8122-j613.dts:/* Through full sleeps and wakes: deep sleep by default. */ &sleep { apple,sleep-tested; }; -
post an exact-head row from the J613 booted on the 27.2 stub. Use the same shape as your 25G83 row: the default command line,
mem_sleepreadings2idle [deep], 3 default deep sleeps and 1 s2idle, GPU/Wi-Fi/audio back after each wake, 0 failed units, and no Oops, WARN or GPU faults.
Blocker 2: the J615 gets it with no row. t8122-j613-dcp-25g83.dtsi is also included by t8122-j615-25g83.dts, the experimental J615 profile. At this head that J615 gets deep sleep as the default, committing, and it has never been slept. (#3413 is the J615 resetting after a committed sleep on 27.2.) Moving the property into t8122-j613.dts fixes this as well, because no J615 file includes it.
I checked both placements on pc (CHECK_DTBS, LLVM, dtschema 2026.9). There were 0 warnings in either case:
| DTB | has the property at this head | after moving it to t8122-j613.dts |
|---|---|---|
t8122-j613.dtb (27.2) |
no | yes |
t8122-j613-25g83.dtb |
yes | yes |
t8122-j615.dtb (27.2) |
no | no |
t8122-j615-25g83.dtb |
yes | no |
t8122-j613-25g83 still inherits the property after the move. That's harmless, and your row already covers it.
If the 27.2 J613 doesn't make it through committed sleeps yet (#3413 may hit it too), keep this as a draft. The binding and driver change should land with the first 27.2 board that uses them, not on their own.
Checks at 574954eb4051. Hosted apple-build, dt-checks, host-tests and KUnit plan are green at this head. On pc I also ran these:
dt_binding_checkonapple,t8140-sleep.yaml: clean;- CHECK_DTBS on the four J613/J615 DTBs: 0 warnings;
drivers/soc/apple/sleep.o(asahi config, LLVM): builds with no warnings;- the KUnit planner on these three files: no suites;
tools/asahi/sep-suspend-errors-tests.py, which readssleep.c: 7/7.
Rows needed to merge:
- J613 on the 27.2 stub at the new head (yours), as above.
- J773g (M4 mini, 27.2) control, which we'll run.
sleep.cis shared and T8132 goes through the same probe,.validand.beginpaths, so the row checks that/sys/power/mem_sleepand the apple-sleep probe lines match main and that one default deep sleep wakes clean. If the new head changes only the J613 DTS, a run at574954eb4051still counts, since thesleep.cand binding commits stay the same.
Once the property moves, the title and the Risk line need updating too ("25G83 firmware" becomes 27.2 J613).
Move apple,sleep-tested from t8122-j613-dcp-25g83.dtsi to t8122-j613.dts so J613 enables default deep sleep on the 27.2 board devicetree (with t8122-j613-25g83.dts inheriting it) and t8122-j615-25g83.dts no longer inherits the property without a row. Signed-off-by: Satya Benson <satya@benson.earth>
|
Thanks for the review and for catching the J615 25G83 leak. Pushed
|
|
Row:
|
|
Row: cea9f3c + J615 (MacBook Air 15" M3, T8122, macOS 27.2 firmware) + default cmdline + PASS (27.2 control without
So on a J615 with 27.2 firmware this PR changes nothing until the J615 tree carries the marker. |
…tested Signed-off-by: Satya Benson <satya@benson.earth> # Conflicts: # arch/arm64/boot/dts/apple/t8122-j613.dts
|
Row: Merged
With |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
…tested Signed-off-by: Satya Benson <satya@benson.earth> # Conflicts: # drivers/soc/apple/sleep.c
|
Merged |
RyanTheTide
left a comment
There was a problem hiding this comment.
The merge keeps the sleep-tested property on J613 only and preserves the base’s missing-parts check. T8122 is marked derived, so the new adjacent base check does not change the tested path. The J613 receipt on the immediately preceding head covers three default-command-line deep cycles and one s2idle, and J615 remains the no-property control.
DjDeveloperr
left a comment
There was a problem hiding this comment.
Approving the code at 19dbc9dbb395. This answers our earlier change request. One thing is left before it merges: a J613 row at this head (below).
Our two blockers. The property now sits in t8122-j613.dts, not in the 25G83 dtsi, so the J615 no longer gets it. The J613 on the 27.2 stub passed 3/3 default deep sleeps and 1/1 s2idle at 83a3357be3f9.
Only the J613 changes. The head is current main (cff875630c61, with #3629) plus the three files. I built these DTBs from it:
| DTB | apple,sleep-tested |
|---|---|
| t8122-j613, t8122-j613-25g83 | yes |
| t8122-j615, t8122-j615-25g83, j433, j434, j504 | no |
| t6030-j516s, t8132-j713, t8132-j773g, t8140-j700 | no |
In sleep.c, s->untested can only differ from soc->untested on a node with the property. Only T8122 and T8112 are marked untested, and no T8112 file sets it. T8132 and T8140 go through the same code as on main, including #3629's missing-parts check.
What moved between 83a3357be3f9 and this head.
sleep.c: #3629's missing-parts check and itsdisplay_power_dtflag. The check is behind!s->soc->derived. T8122 is derived, so the J613 never runs it, and the flag is read only there.- The binding and
t8122-j613.dts: unchanged. - The J613 DTB: #4064 moves the idle polling delay of six CPU thermal zones from 500 to 2000 ms.
- The DART, radio, display-gate and DCP changes from main are for T8132 and T6031. The J613 has no managed-sids host, and T8122 doesn't set
only_120hz_modes.
Checks on this exact tree. sleep.o at W=1 with WERROR (LLVM): no warnings. The 11 DTBs above build. dt-doc-validate (dtschema 2026.9) and yamllint on the binding: clean. Host tests pass: sep-suspend-errors 7/7, m3-sleep-steps 4/4, display-sleep-merge, dart-sleep power, snapshot and writer, tb-cio-sleep. Hosted apple-build, host-tests and dt-checks are green.
Still needed to merge: a J613 (27.2) row at 19dbc9dbb395, from satchlj. The merge policy carries a row over a merge of main only when the touched files don't conflict. I repeated this merge and sleep.c conflicts in apple_sleep_probe(), where the two checks meet. The resolution is right: it keeps both checks. But the row has to be run on it. The same shape as the last one is fine (default command line, 3 deep sleeps, 1 s2idle). Please don't merge main again before the row unless you have to.
Not blocking: the PR text says the J773g control row read [s2idle]. The row itself says s2idle [deep], same as stock. Please fix that line, and the head it names.
|
Row: 19dbc9d + J615 (MacBook Air 15" M3, T8122, macOS 27.2 / 26B123 stub) + default cmdline + PASS (with
|
What: deep sleep by default on the M3 MacBook Air 13" (J613, T8122): no
apple_sleep.deep=1and noapple_sleep.untested_commit=1on the command line. Required for daily-use deep sleep on J613 on the default command line.T8122's sleep data is marked untested in the driver, which does two things: deep sleep is offered only with
apple_sleep.deep=1and is never the default, and every sleep stops at a dry run before the commit unlessapple_sleep.untested_commit=1. Rather than flipping the entire T8122 family before every board is verified, the board devicetree declares when deep sleep is verified on that machine:dt-bindings: soc: apple: sleep: add apple,sleep-tested: a boolean on the sleep node.soc: apple: sleep: take the untested opt-ins off a node with apple,sleep-tested: on a SoC marked untested, a node with the property gets deep sleep offered, as the defaultmem_sleep, and committing. It runs exactly the steps a sleep runs today with both parameters set. What derived data needs regardless (PMU step notes, the T8142 last-WFI stub and probe reports) stays keyed on the SoC. A node without the property keeps today's behaviour, including a DT from an older boot loader.arm64: dts: apple: t8122-j613: setsapple,sleep-testedon&sleepinarch/arm64/boot/dts/apple/t8122-j613.dts(inherited byt8122-j613-25g83.dts). Neithert8122-j615.dtsnort8122-j615-25g83.dtsreceives it.Default
mem_sleep: this PR covers it. The driver already makes deep the default sleep state for any SoC it doesn't treat as untested (suspend_set_ops(), then it demotes to s2idle only when untested). So on a node withapple,sleep-tested,mem_sleepreadss2idle [deep]and a plainsystemctl suspendsleeps deep.mem_sleep_default=s2idlestill picks s2idle.Depends on: #3504 (M3 GPU firmware-driven deep sleep), #3590 (audio clocks across deep sleep), and #4037 (T8122 V27 DCPext DART save/restore &
ext_idle) — all merged and included in this head (83a3357be3f9, merged cleanly ontomainbbb91e2a416d).Tested:
83a3357be3f9: compiled all four J613/J615 DTBs and verified/soc/sleep-controller@2d0700000:t8122-j613.dtb:apple,sleep-testedpresent (sha256: b1376ddc0f3df5c67531a4b3169bcb94f1b6cc473e8c2c34b6f23bf4f0383433)t8122-j613-25g83.dtb:apple,sleep-testedpresentt8122-j615.dtb: absentt8122-j615-25g83.dtb: absent83a3357be3f9(26B123,mBoot-20457.41.3, default command line — noapple_sleep.*params): PASS/proc/device-tree/soc/sleep-controller@2d0700000/apple,sleep-testedpresent;/sys/power/mem_sleepdefaulted tos2idle [deep];apple-sleeploggedsleep data derived for this SoC, through full sleeps and wakes on this machine (apple,sleep-tested)anddeep sleep is the default: boot object resumes 0;0failed units.rtcwake -d rtc1 -m mem -s 15):boot object resumes 0 -> 1 -> 2 -> 3, wakeNUB.SPMI0.SW3,156 of 224 AP pinsrestored every wake,apple-dcpV27 wakeplain-on 0@23,aurora-g16GPU firmware back in1165 us/1215 us/1157 us, Borealisglmark2-es2-drm1718/1720/1727 FPS(vulkaninfoApple M3 G15G C0 / Borealis), 48 kHz & 44.1 kHz silent audio capture timing4033/4017,4025/4023,4024/4025 ms, Wi-FiUP,0failed units.s2idle(rtcwake -d rtc1 -m freeze -s 12):suspend_stats: success=4 fail=0, Borealis2256 FPS, audio capture4031/4041 ms, Wi-FiUP,0failed units.apple,sleep-tested(posted in comments below, samesleep.cand binding):mem_sleepunchanged[s2idle]).mem_sleepunchanged[s2idle]).Risk: two-way · J613 (27.2 and inherited 25G83 DTBs) only (a plain revert restores the opt-ins). Every other Mac, including J615 (27.2 and 25G83), is unchanged. Only a DT built from this tree carries the property, so a machine changes behaviour once its boot loader's devicetree includes it.
Not yet:
apple,sleep-testedin this PR).