Repository navigation
soc: apple: sleep: keep s2idle default on legacy GPU/DCP firmware - #4207
Conversation
On T8103 (M1) and T8112 (M2) systems still running a legacy 12.x/13.x OS firmware stub, the device tree advertises apple,firmware-compat <13 5 0> on both the GPU and internal display coprocessor. In that configuration the GPU binds the legacy backend (which has no deep-sleep path and unconditionally returns -EBUSY from sleep_prepare()) and the internal DCP has no deep-sleep wake restart path (leaving the panel off until reboot). apple_sleep_undescribed() did not check these firmware-compat properties, so T8103 promoted deep sleep to the default on 13.5 stubs. Every suspend attempt then failed at GPU prepare (-16), and systemd-sleep's immediate fallback to freeze (s2idle) also failed with -EBUSY while dwc3-apple was still running its post-suspend recovery work. Record the GPU DT node in T8103/T8112 map_regs and check both the internal display (< 14.x) and GPU (< 27.x) firmware-compat in apple_sleep_undescribed() so s2idle remains the default unless the user explicitly asks for deep sleep. Also log a warning in aurora's sleep_prepare() when the legacy GPU backend refuses an explicit deep sleep, and add a host test covering the legacy/27.2 combinations. Signed-off-by: Dmitrii Semenenko <116227467+Sedmio@users.noreply.github.com>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
Signed-off-by: Dmitrii Semenenko <116227467+Sedmio@users.noreply.github.com>
|
The J313 receipt names |
|
Re-tested on hardware at head
I don't have a |
|
Interaction with #3534 (T6000 deep sleep), raised by the J316s lane: the display check here is in the generic |
|
Note on how this interacts with #3534 (T6000 deep sleep). Not a hardware row, just a read of the code at The display check in if (disp && of_device_is_available(disp) &&
!of_property_read_u32_array(disp, "apple,firmware-compat", fw, 3) &&
fw[0] < 14)
missing++;#3534 adds a T6000 profile with Two ways to fix it:
Either way works for #3534's J314s/J316s. I'll post our J316s deep row on #3534 shortly. The J473 27.2-stub control row for this PR is queued in the same batch. |
Gate the < 14 internal DCP apple,firmware-compat check in apple_sleep_undescribed() behind a per-SoC display_legacy_no_wake flag enabled only on T8103 and T8112. SoCs with a working 13.x DCP deep-sleep wake path (such as T6000 in aurora-silicon#3534) now keep their deep-sleep default unaffected. Extend the host test suite with a T6000 13.5 case verifying display_legacy_no_wake = false leaves apple_sleep_undescribed() at 0. Signed-off-by: Dmitrii Semenenko <116227467+Sedmio@users.noreply.github.com>
|
Good catch on #3534 — updated at SoCs without Hardware receipt at head
|
|
J473 control half at exact head
Afterwards the Mac went back to its production default (fleet94, Enforcing, 0 failed units, no extra cmdline left). |
There was a problem hiding this comment.
Verdict: MERGE at f81e62a
Blockers: None.
Checked: The display check uses the sleep profile's wake capability and the DCP firmware compatibility reported in the DT. T6000 keeps its 13.5 panel wake path. The GPU node reference is released through devres on removal and probe failure. The prepare callback leaves s2idle and the existing deep-capable backends alone. No DT node or binding changes are needed for the existing properties.
Evidence
The exact host fixture passed all eight assertions on legacy, 27.2, disabled and unaffected profiles. Removing the display capability check made its T6000 13.5 assertion fail. The author’s exact J313 row reports s2idle as the default, a successful PMU RTC suspend/resume, and a clean -EBUSY on an explicit deep request. The earlier J473 27.2 control confirms that the existing untested-profile policy keeps s2idle as default there.
|
Legacy-stub half at exact head
Afterwards the Mac went back to its production default ( |
|
27.2-stub control row for this PR: #4207
I can't run the legacy half on our J413 (M2 Air, 13.5 stub) yet, because another lane holds it. I'll post it when I get the Mac. |
|
Correction to my control row above: our J413 turned out to be on a 27.2 OS stub too ( |
…dle default) (#572) Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
RyanTheTide
left a comment
There was a problem hiding this comment.
ORCH5 merge sweep: passes the six-point gate (CI green at f81e62a, independent review approval by aurora-silicon-review[bot], no taint, no Stage 1/LocalPolicy change).
What: Keep
s2idleas the default sleep mode when the DT advertises legacy GPU (< 27.xon T8103/T8112) or legacy internal display (< 14.x)apple,firmware-compat, instead of promotingdeepto default where every suspend fails at GPUprepare(-16) and cascades into a faileds2idlefallback (addresses omacom/linux-aurora#567). Also log an explicit warning inaurora'ssleep_prepare()when the legacy GPU backend refuses an explicitdeeprequest, and add a host test covering legacy and 27.2 combinations.Tested: J313 M1 Air (13.5 OS stub / 27.2 system firmware) at
b5484a7d9dae: boots withs2idledefault ([s2idle] deep), 1/1s2idlesuspend/resume pass (fail=0), explicitdeeprequest refused cleanly with the new legacy-backend warning;tools/asahi/run-host-tests.py --only sleep: 52/52 passed.Risk: two-way door · M1 (T8103) and M2 (T8112) Macs; affects default
mem_sleepselection only when DTapple,firmware-compatis legacy (< 14on internal DCP or< 27on GPU).Not yet: T8103/T8112 on a 27.2 OS firmware stub (covered by host tests verifying
27.2.0leavesdeepas default).Details
drivers/soc/apple/sleep.c,sleep-t8103.h,sleep-t8112.h: store the T8103/T8112 GPU DT node ins->gpu_np(managed withdevm_add_action_or_reset(..., apple_sleep_put_node, np)) and checkapple,firmware-compatinapple_sleep_undescribed():disp) withfw[0] < 14(legacy 12.x/13.x DCP has no deep-sleep wake restart path, leaving the panel dark until reboot).s->gpu_np) withfw[0] < 27(routes to the legacyGpuManagerG13/GpuManagerG14backend, which unconditionally returns-EBUSYfromsleep_prepare()).apple_sleep_probe()keepss2idleas the default while still offeringdeepif requested viamem_sleep_default=deepor/sys/power/mem_sleep.drivers/gpu/drm/asahi/driver.rs: logdev_warn!before returning-EBUSYon the legacy fallback arm ofsleep_prepare(), replacing a silentgenpd_prepare returns -16.tools/asahi/sleep-legacy-fw-tests.{c,py}(registered intools/asahi/run-host-tests.py): exercisesapple_sleep_undescribed()across laptop/desktop 13.5, 27.2, disabled-node, and non-legacy SoC combinations.Evidence
J313 M1 Air (
apple,j313/apple,t8103,asahi,os-fw-version=13.5,asahi,system-fw-version=27.2) atb5484a7d9dae(7.3.0-legacyfw-test+):Boot logs:
/sys/power/mem_sleepandsuspend_statsaftersystemctl suspend:Suspend log:
Explicit
deepcheck (echo deep > /sys/power/mem_sleep && echo mem > /sys/power/state):Host tests (
python3 -I tools/asahi/run-host-tests.py --only sleep):Build & checkpatch:
LLVM=1build (Image+ modules, includingdrivers/soc/apple/sleep.oanddrivers/gpu/drm/asahi/aurora.ko): 0 errors.scripts/checkpatch.pl -g HEAD: 0 errors.Note on unrelated pre-existing system state on this Omarchy
0.2.13-1userspace againstaurora-silicon/linuxmain:speakersafetyd.service(needsomacom/omarchy-mac-pkgs#210),systemd-growfs-root.service(omacom/omarchy-mac-pkgs#247), and onefpwm1power-state error on resume were unrelated to this change.