Skip to content

soc: apple: sleep, mfd: macsmc, drm/apple: Select the T8142 sleep paths by hardware, not J813 - #2384

Draft
RyanTheTide wants to merge 2 commits into
integration/aurorafrom
spec-m5neo/t8142-air-parity-sleep
Draft

RyanTheTide wants to merge 2 commits into
integration/aurorafrom
spec-m5neo/t8142-air-parity-sleep

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Problem

Three parts of the T8142 suspend path checked of_machine_is_compatible("apple,j813"), so the 15-inch Air (J815, same die, same SMC, ANS and DCP) was left out:

  • drivers/soc/apple/sleep.c:1783 apple_sleep_smc_defer_notice(): the final SMC MBSE/AP IDLE notice after the peer stops (f1aa5a5, "soc: apple: sleep: send J813's final SMC notice after peer stops"). The reason given there is the T8142 sequence: ANS fails its IOP IDLE handshake when the SMC is told first.
  • drivers/mfd/macsmc.c:656: the bounded, IRQ-independent SMC transport that the deferred notice needs (same commit).
  • drivers/gpu/drm/apple/dcp.c:9405: the DCP firmware stop at system suspend (b29e3c7, "drm/apple: dcp: stop the J813 firmware during system suspend").

Change

  • struct apple_sleep_soc gets smc_notice_after_peers, set for apple,t8142-sleep. apple_sleep_smc_defer_notice() reads it instead of the board.
  • apple_sleep_smc_defer_notice_hw() answers the same from the DT (an available sleep controller whose profile has the flag), so macsmc can pick its transport at probe before the sleep driver binds. macsmc uses it instead of the board.
  • dcp.c drops the board check. dcp_s2r_capable() already requires the DCP's apple,display-power in the DT and, for derived power words, appledrm.s2r_untested on firmware 27.0, so the DT property now selects it.

Testing

  • Compiled drivers/soc/apple/sleep.c, drivers/mfd/macsmc.c and drivers/gpu/drm/apple/dcp.c before and after with the release config's kbuild command line and W=1 (drm's extra warnings for dcp.c): no compiler warnings on either side. macsmc.o now references apple_sleep_smc_defer_notice_hw, which sleep.o exports.
  • Which boards are affected, from the DTs in the tree: only J813 has an apple,t8142-sleep node and a DCP apple,display-power today, so this branch alone changes nothing on any board. Together with arm64: dts: apple: t8142: Give J813 and J815 the same SoC nodes #2383 (the J815 sleep/display-power DT), J815 gets the same path as J813. J704 has neither node and stays as it is. T8140, T8132 and T6050 profiles leave the flag clear; on them the DCP condition was already true.

Still to run

Details
  • The TEST-ONLY switch apple_sleep.j813_smc_late keeps its name so existing command lines still work; only its description changes.
  • macsmc's T6050 board list (saved_enabled for j714s/j716c) is not touched here.
  • Credit: the deferred notice and the DCP suspend stop are sithglan's (f1aa5a5, b29e3c7).

Assisted-by: LLM (Claude:Opus 5.5)

The final SMC MBSE/AP IDLE notice waits for the peer stops because on
T8142 ANS fails its IOP IDLE handshake when the SMC is told first. That
is a property of the T8142 sleep sequence, but both the deferral
(apple_sleep_smc_defer_notice()) and macsmc's bounded transport for it
were selected by of_machine_is_compatible("apple,j813"), which leaves
out J815 with the same SoC, SMC and ANS.

Add smc_notice_after_peers to struct apple_sleep_soc, set it for
apple,t8142-sleep, and read it instead of the board. macsmc picks its
transport at probe, before the sleep controller binds, so add
apple_sleep_smc_defer_notice_hw(), which answers the same from the
device tree: an available sleep controller whose profile has the flag.

Only J813 has an apple,t8142-sleep node today, so no board changes
behaviour until a device tree adds one; T8140, T8132 and T6050 leave
the flag clear. The TEST ONLY switch keeps its name.

Fixes: f1aa5a5 ("soc: apple: sleep: send J813's final SMC notice after peer stops")
Suggested-by: Thomas Glanzmann <thomas@glanzmann.de>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The DCP firmware stop at system suspend skipped every DCP with derived
power words (hw.s2r_untested, T8142) unless the machine was J813. The
stop needs the display's power words, which the device tree gives the
DCP as apple,display-power, and dcp_s2r_capable() already requires
them: dcp_s2r_check_dt() clears hw.s2r without the property, and probe
clears it for derived words unless appledrm.s2r_untested is set on
firmware 27.0.

Drop the board check, so the property selects the path. Today only J813
has apple,display-power on a T8142 DCP, so nothing changes until a
device tree adds it (J815 shares J813's nodes); other SoCs were never
behind the check.

Fixes: b29e3c7 ("drm/apple: dcp: stop the J813 firmware during system suspend")
Suggested-by: Thomas Glanzmann <thomas@glanzmann.de>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@gig3m

gig3m commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

J813 (MacBook Air 13" M5), macOS 27.2 stub, with #2384 on #2135's merged head and the usual apple_sleep test switches plus appledrm.s2r_untested=1. No change from before.

Two deep cycles with a 30 s alarm: both clean (suspend_stats: success=2 fail=0). Each woke on NUB.SPMI0.SW3, resumes 0 -> 1 -> 2. After each wake, all 10 CPUs, Wi-Fi, Bluetooth, NVMe reads and a VP9 hardware decode (0 of 90 frames wrong) were fine.

With the board check gone, the DCP path is now selected by apple,display-power, and it still comes up at boot: apple-dcp 286e00000.dcp: firmware stop enabled (appledrm.s2r_untested).

Both cycles logged the deferred SMC notice after the N1 sleep handshake:

apple_centauri 0000:01:00.0: TEST: Alpha ACIPC host sleep: ret=0 status=3 exec=2 ipc=2
apple-sleep 380700000.sleep-controller: TEST: SMC notice after peer stops: 0
macsmc 38c600000.smc: wake record: MBSE 0x10650, ...

After a wake, the panel came back with wake: panel on in 55 ms (firmware 1 ms).

🤖 Generated with Claude Code

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