Repository navigation
soc: apple: sleep, mfd: macsmc, drm/apple: Select the T8142 sleep paths by hardware, not J813 - #2384
RyanTheTide wants to merge 3 commits into
Conversation
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>
|
J813 (MacBook Air 13" M5), macOS 27.2 stub, with #2384 on #2135's merged head and the usual Two deep cycles with a 30 s alarm: both clean ( With the board check gone, the DCP path is now selected by Both cycles logged the deferred SMC notice after the N1 sleep handshake: After a wake, the panel came back with 🤖 Generated with Claude Code |
|
Thanks @gig3m. This is the J813 no-change row the PR asked for.
|
|
J813 (MacBook Air 13" M5), macOS 27.2 stub, one s2idle cycle on the tree from my deep row (#2384 on #2135's merged head,
🤖 Generated with Claude Code |
Conflict: drivers/mfd/macsmc.c (kept integration's new apple_smc_sleep_saved_woken(), reworded its following comment from J813 to the deferred notice as the PR does). Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Merged integration/aurora (d1b022d); conflict in drivers/mfd/macsmc.c resolved (kept the new apple_smc_sleep_saved_woken(), comment reworded as in the PR); sleep.o, macsmc.o and drm/apple dcp.o build (arm64 defconfig+asahi.config) without warnings. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR review at verified live head f9d03e8175e91ddd05622453e13ef57c43d00ddb against live integration/aurora (70a00e583b03, not superseded).
Verified Clean (§1–§4 Code Audit)
- Hardware/DT selection (§1): Replacing
of_machine_is_compatible("apple,j813")witht8142_sleep_soc.smc_notice_after_peers,apple_sleep_smc_defer_notice_hw(), anddcp_s2r_capable()is the right direction. - Locking/refcounting/Kconfig/section safety (§2–§3):
apple_sleep_of_matchisstatic const(not__initconst),for_each_matching_node_and_match()iterates to completion without refcount leaks,CONFIG_APPLE_SOC_SLEEPisbool(safe for bothMFD_MACSMC=yand=m, with stub for=n), and T8142 is the sole.s2r_untested = trueprofile indrivers/gpu/drm/apple/dcp.c:10114. - Attribution (§4): All 3 commits carry human author/committer and human
Signed-off-by:only (zero AI commit trailers); PR body discloses assistance.
Blockers Before APPROVE
- §5 Missing J815 hardware verification & exact-head regression triad (behaviour is now LIVE on J815):
- Commit
5ef8284e21f6(arm64: dts: apple: t8142-j815: Share J813's sleep and power nodes) already landed on liveintegration/aurora(70a00e583b03), sot8142-j815.dtsalready carries bothapple,t8142-sleep(t8142-j813-j815-sleep.dtsi) andapple,display-power(t8142-j813-j815.dtsi:426). - Merging #2384 therefore immediately flips
smc->saved_enabled = trueon every default-cmdline J815 boot (switchingmacsmctodevm_apple_rtkit_init_m5_saved()and enablingapple_smc_saved_guard()/saved_pendingon all SMC commands), activates the deferred SMC notice, and activates the DCP suspend firmware stop on J815 — yet there is zero J815 boot or deep/s2idle hardware run on this PR. - The J813 runs (
gig3m, Nov 19–20) predated the Nov 22 conflict-resolution mergef9d03e8175e9indrivers/mfd/macsmc.c, omitted the §5 regression triad (0 SELinux denials, 0 failed units, 0 new kernel errors), and noted a newdwc3-apple 40a280000.usb: PM: device_prepare(): genpd_prepare returns -11line on s2idle. - Please post exact-head J815 (default-cmdline boot + deep/s2idle cycle) and J813 rows with the §5 regression triad.
- Commit
- Stale/inaccurate commit messages (
32ddf053cfe1and8407d407ba85):- Both commit messages still state "Only J813 has an apple,t8142-sleep node today, so no board changes behaviour until a device tree adds one" / "Today only J813 has apple,display-power on a T8142 DCP, so nothing changes until a device tree adds it", which is now factually wrong on live
integration/aurora(5ef8284e21f6). Please update them to reflect that J815 already shares both nodes.
- Both commit messages still state "Only J813 has an apple,t8142-sleep node today, so no board changes behaviour until a device tree adds one" / "Today only J813 has apple,display-power on a T8142 DCP, so nothing changes until a device tree adds it", which is now factually wrong on live
- §6 Missing current live CI checks:
- Live
integration/auroraadded.github/workflows/apple-drm-kunit.yml(drivers/gpu/drm/apple/**) and.github/workflows/pmgr-pwrstate-kunit.yml(include/linux/soc/apple/**) on2026-11-23; neither has run onf9d03e8175e9. - Please rebase/merge onto live
integration/aurorasoapple-drm-kunit,pmgr-pwrstate-kunit,sep-source, andhost-testsall pass green on the updated head.
- Live
Non-Blocking Note
drivers/soc/apple/sleep.c:6410still logspanic("J813 SMC notice failed after peer stops: %d", ret);anddrivers/mfd/macsmc.cstill namesapple_smc_j813_saved_ops/apple_smc_j813_saved_end; worth generalizing while cleaning up the commit messages.
Assisted-by: LLM (Gemini 4 Neon)
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:1783apple_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_socgetssmc_notice_after_peers, set forapple,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_s2r_capable()already requires the DCP'sapple,display-powerin the DT and, for derived power words,appledrm.s2r_untestedon firmware 27.0, so the DT property now selects it.Testing
drivers/soc/apple/sleep.c,drivers/mfd/macsmc.canddrivers/gpu/drm/apple/dcp.cbefore 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 referencesapple_sleep_smc_defer_notice_hw, which sleep.o exports.apple,t8142-sleepnode and a DCPapple,display-powertoday, 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
echo deep > /sys/power/mem_sleep; rtcwake -m mem -s 20with the usualapple_sleeptest switches andappledrm.s2r_untested=1). Expected: dmesg shows the deferred SMC notice after the ANS stop, the DCP firmware stops and restarts, the panel returns.Details
apple_sleep.j813_smc_latekeeps its name so existing command lines still work; only its description changes.saved_enabledfor j714s/j716c) is not touched here.Assisted-by: LLM (Claude:Opus 5.5)