Skip to content

soc: apple: sleep, mfd: macsmc: take the T8142 late SMC notice from the DT - #3736

Open
RyanTheTide wants to merge 3 commits into
mainfrom
gates/smc-late-notice
Open

RyanTheTide wants to merge 3 commits into
mainfrom
gates/smc-late-notice

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

What: take the T8142 "tell the SMC last" sleep behaviour from the device tree instead of the machine name. sleep.c had of_machine_is_compatible("apple,j813") plus a TEST ONLY apple_sleep.j813_smc_late parameter (default on), and macsmc.c had its own of_machine_is_compatible("apple,j813") for the bounded saved-state transport the late notice needs (#3172 audit gate). New boolean apple,sleep-late-notice on the SMC node (binding in mfd/apple,smc.yaml): macsmc enables the saved transport for an SMC with it, and the sleep controller defers the SMC notice when an available node carries it. The parameter goes; no board names left for this in either driver. The property is set on the SMC node J813 and J815 share (t8142-j813-j815.dtsi).
Tested: no hardware row (T8142 boards are not in our fleet). Buildbox at ac2c39ca86b3: sleep.o + macsmc.o with arm64 defconfig + asahi.config, LLVM=1, W=1: 0 warnings (same as main). make dtbs (all arm64): 0 warnings; DTB diff against main: only t8142-j813.dtb and t8142-j815.dtb change, each by the one apple,sleep-late-notice; line. dt_binding_check DT_SCHEMA_FILES=mfd/apple,smc.yaml clean; CHECK_DTBS=y on t8142-j813, t8142-j815, t8142-j704, t6050-j714s clean. KUnit on arm64 QEMU (macsmc.kunitconfig + APPLE_SOC_SLEEP_KUNIT_TEST, test merge 5af4bc20740c with the other two B1-GATES branches): 55 tests, 54 passed, 1 skipped (needs UCLAMP_TASK).
Risk: two-way door; T8142 J813 and J815 deep sleep only (J704 has neither a sleep controller nor the property). J813: same as today with the in-tree DTB. J815: gets the late notice it did not have on main; that is the path its deep-sleep PASS rows in #3134/#3135 ran (j815/prtest-r8 carried #2384, which turns it on for all T8142). Other SoCs: unchanged (T8103 keeps its gen-1 path; no other DT has the property).
Not yet: deep-sleep rows at this head from the owners: @m0d16l14n1 (J815) and J813 (@sithglan, @gig3m, @DjDeveloperr per #2384). Overlaps #2384, which moves the same two checks to a smc_notice_after_peers SoC flag and keeps the parameter; this PR does the sleep/macsmc half by DT instead, and #2384's dcp.c change is not covered here.

Details

Commits:

  1. soc: apple: sleep, mfd: macsmc: take J813's late SMC notice from the DT: binding, driver changes, property in t8142-j813.dts.
  2. arm64: dts: apple: t8142: give J815 the late SMC notice too: moves the property to the SMC node in t8142-j813-j815.dtsi.

sleep.c reads the property at probe with of_find_node_with_property() (the SMC can probe before or after the sleep controller; the answer is read at suspend). macsmc reads it from its own node at probe.

Side note, not changed here: macsmc's other condition for the saved transport, of_device_is_compatible(np, "apple,t8103-smc"), is meant for T8103, but apple,t8103-smc is also the fallback compatible of t6020/t6030/t6031/t6041/t8122/t8132/t8140/t8142 SMC nodes, so it is true on those too. Flagged for a separate fix with rows on those Macs.

J813's SMC is told of a deep sleep last, after SEP and the other
coprocessors have stopped, over the bounded saved-state transport
(linux#3172). Both drivers chose that by machine name
(of_machine_is_compatible("apple,j813")), and sleep.c also kept a
read-only j813_smc_late module parameter for it, on by default.

Describe it instead: apple,sleep-late-notice on the SMC node, set in
the J813 device tree. macsmc enables the saved transport for an SMC
with the property, and the sleep controller defers the notice when an
available node carries it. The parameter goes away (its default is
the behaviour). No board names are left in either driver for this.

The J815 shares the T8142 SoC but never had the late notice; its tree
does not get the property, so nothing changes there. J813 behaves as
before with the in-tree DTB.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
J813 and J815 share the T8142 sleep controller, SMC and ANS, and the
reason for the late notice is the SoC's sequence: ANS fails its IDLE
handshake when the SMC is told first. The J815 deep sleep runs behind
linux#3134 and linux#3135 were taken with the notice after the peers
(linux#2384 in the candidate). Move apple,sleep-late-notice from the
J813 tree to the SMC node both boards share.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide requested review from a team as code owners December 1, 2026 05:00

@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 ac2c39c

Checked: binding, DTSI and both drivers.

  • macsmc: the saved transport is now enabled by apple,sleep-late-notice on its own node, or by apple,t8103-smc as before.
  • sleep.c: the notice is deferred when any available node carries the property. It is read once at probe, and apple_sleep is already dereferenced just above the new return in apple_sleep_smc_defer_notice(), so nothing new is dereferenced.
  • The property sits on the SMC node J813 and J815 share, so J813 is unchanged. J815 gains the late notice and the saved transport, which is the path its #3134/#3135 PASS rows ran with #2384. No other DT carries the property. The j813_smc_late parameter (default on) and both board checks are gone.
    Follow-ups:
  • The apple,t8103-smc fallback compatible also matches the t6020…t8142 SMCs (your side note). That needs a separate issue with rows on those Macs.
  • Reconcile or close #2384's overlapping sleep/macsmc half once this lands.

@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) area:power Area from CODEOWNERS (bot) blast:all 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) labels Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Merge readiness at c14e7e38: not ready yet

Check Detail
CI at head no failing: host-tests
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok comment at c14e7e38
Conflicts no merge conflicts with main: merge it in (no force push)
PR text ok Risk: two-way · T8142 J813 and J815 deep sleep only (J704 has neither a sleep controller nor the property). J813: same as today with the in-tree DTB. J815: gets the late notice it did not have on main; that is the path its deep-sleep PASS rows in #3134/#3135 ran (j815/prtest-r8 carried #2384, which turns it on for all T8142). Other SoCs: unchanged (T8103 keeps its gen-1 path; no other DT has the property).

Areas: area:bringup, area:platform, area:power

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@sithglan

sithglan commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Tested at ac2c39ca86b3 on J813 (MacBook Air M5, T8142, fw 27.2): PASS

Machine SoC Head Test Result
J813 T8142 ac2c39ca86b3 Boot with in-tree DTB + 10 s deep sleep (t8142_wake_s=10) PASS
Details
  • One-shot aura-try boot (7.3.0-aurora-j813-pr3736+, in-tree t8142-j813.dtb).
  • /proc/device-tree/soc/smc@38c600000/apple,sleep-late-notice present; /sys/module/apple_sleep/parameters/j813_smc_late removed.
  • Deep sleep cycle (mem_sleep=deep, untested_commit=Y, t8142_wake_s=10, all 10 CPUs online):
    • apple-sleep 380700000.sleep-controller: 10 coprocessors up and stopped
    • apple-sleep 380700000.sleep-controller: TEST: SMC notice after peer stops: 0
    • apple-sleep: T8142 PMU alarm after the timer: 0 (counter 3889938, compare 3889948)
    • apple-sleep 380700000.sleep-controller: back from sleep, boot object resumes 0 -> 1 (wake source NUB.SPMI0.SW3)
    • nvme-apple 4c5cc0000.nvme: ANS: on 169 ms after the run bit, resetting the controller before any I/O
  • Post-resume: suspend_stats/success=1, fail=0, CPUs 0-9 online, internal eDP-1 + external Type-C DP-1 (2560x1440) back, Centauri Wi-Fi re-associated (status=0, ping OK), 0 failed systemd units, 0 new kernel errors.

@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch (bot) label Dec 1, 2026
@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) and removed merge-conflict Conflicts with the base branch (bot) labels Dec 1, 2026
DjDeveloperr
DjDeveloperr previously approved these changes Dec 2, 2026

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

Correct, and it removes the board name and the TEST ONLY parameter. J813 behaves as before with the in-tree DTB, and the J813 row at ac2c39c passed. J815 newly gets the late notice, so the J815 deep-sleep row at this head (or its merge-up) is the hardware gate left. #3791 adds J704 with of_machine_is_compatible("apple,j704"). Whichever lands second should switch J704 to this property. The branch conflicts with main and needs a merge-up. I'll re-approve at the merged head.

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Dec 2, 2026
Two conflicts, both where main moved the lines this branch replaces:
- macsmc.c: main added apple,t8112-smc to the saved-transport
  condition. Keep it, and keep this branch's apple,sleep-late-notice
  in place of the J813 machine check.
- sleep.c: main added the refuse_late parameter next to j813_smc_late.
  Keep refuse_late; j813_smc_late goes, as on this branch.

Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Merged main into this branch as c14e7e38bb08 (a merge commit, no rebase or force push). There were two conflicts. In both, main had changed the lines this branch replaces:

  • drivers/mfd/macsmc.c: main added apple,t8112-smc to the saved-transport condition. The merge keeps it, and keeps this branch's apple,sleep-late-notice in place of the J813 machine check.
  • drivers/soc/apple/sleep.c: main added the refuse_late test parameter next to j813_smc_late. The merge keeps refuse_late and drops j813_smc_late, as this branch does.

Against main 1b95b711bbc2, the merge changes the same 4 files as before (+31/−8). Local checks on the merge tree, arm64 + asahi config, LLVM=1:

  • W=1 build of drivers/soc/apple/sleep.o and drivers/mfd/macsmc.o: 0 warnings.
  • t8142-j813.dtb and t8142-j815.dtb build with 0 warnings, and each has apple,sleep-late-notice once.
  • No j813_smc_late or apple,j813 check remains in either driver.

What's left:

  • One review of this merge from someone other than DjDeveloperr (the last pusher).
  • A J815 deep-sleep row at c14e7e38 from the J815 owner. J815 newly gets the late notice.
  • A J813 recheck at c14e7e38. The J813 PASS at ac2c39ca ran on the old base.

T8142 machines aren't in our fleet, so those rows have to come from their owners.

@github-actions github-actions Bot added 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 2, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Independent review of merge c14e7e38bb08, by a reviewing agent that didn't make the merge: no blocking findings.

Against main, the merge is exactly this PR's four hunks:

  • macsmc.c keeps main's apple,t8112-smc and swaps the J813 machine check for apple,sleep-late-notice.
  • sleep.c keeps main's refuse_late and drops j813_smc_late.
  • The DT line sits inside the smc@38c600000 node.

Nothing in the tree still refers to j813_smc_late, and main added no new caller of apple_sleep_smc_defer_notice().

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Dec 3, 2026
@aurora-silicon-review
aurora-silicon-review Bot removed the request for review from joshuaswarren December 3, 2026 04:32
@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch (bot) label Dec 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bringup Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) area:power Area from CODEOWNERS (bot) blast:all Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) merge-conflict Conflicts with the base branch (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