Repository navigation
arm64: dts: apple: t8112-j413-fw27: enable deep sleep by default with PCIe-C s2idle fallback - #3786
Conversation
5a03cf5 to
8c8cce3
Compare
|
Rebased onto current Verified at
Keeping as draft until an exact-head default-command-line T8112 verification row runs. |
|
Exact-head default-command-line J413 (M2 Air, macOS 27.2 stub) verification row at
|
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
Verdict: MERGE at 8c8cce3
Checked:
- Diff is one line in the profile,
.untested = truedropped fromt8112_sleep_soc, plus its KUnit expectation. Insleep.cthe untested flag only gates the dry run and the commit (s->soc->untested && !sleep_untested_commit), so with it cleared T8112 takes the same commit path that #3774's 50/50 J413 row exercised withuntested_commit=Y. Nothing else changes. apple_sleep_test_known_profiles: the newEXPECT_FALSEsits in a branch forapple,t8112-sleeponly. T8122 keeps its ownuntested == 1expectation and T8142 its0, so the test can't pass by accident for another SoC.- Exact-head J413 default-cmdline row:
s2idle [deep]out of the box, 10/10 RTC deep sleeps with keyboard, GPU and Wi-Fi back. That's the merge gate's one row on one Mac.
Follow-ups (not blocking):
- This makes deep sleep the default on every T8112 Mac, including the J473 desktop, which sleeps on its own and has had s2idle/display regressions before (#2953, #2853). A J473 default-cmdline row with the monitor attached is the most valuable next check.
mem_sleep_default=s2idleremains the per-Mac escape hatch. - Lid / AC-unplug wake and external display across deep sleep, as the PR lists.
|
Row: 8c8cce3 + J473 (Mac mini M2, 27.2 stub, USB-C + HDMI monitors) + default is deep as claimed; every deep suspend aborts on the existing linux#3790.
So on J473 the new default lands on #3790. This PR doesn't cause it, but with it, J473 suspend now fails outright where it used to fall back to s2idle. Your call whether #3786 waits for #3790 or #3790 follows it. |
|
@RyanTheTide Thanks for the exact-head J473 row — that is a clear regression in default suspend on J473 (and likely any T8112 with a USB-C display attached, going from working s2idle to a latched |
|
J413 (MacBook Air 13" M2, T8112, 27.2 stub) steady-state deep-sleep power measurement on
Note: |
|
Row: 8c8cce3 on main
USB, network, NVMe and GPU (deqp triangle) were fine after it; no DCP crash lines.
On the J473 today, deep by default turns a working s2idle into an abort and then a reset, so this still waits on the J473 DCP deep-sleep fix (#3790 / #3822). Next I run #3822 |
|
Following up on @RyanTheTide's J473 bisection on #3822 ( Auditing
Proposed next step:
I will put together a patch for the missing |
|
Quick follow-up on the missing T8112 domain patch idea: tested a prototype adding Looking at active genpd domains on J413, the only two domains from that patch that were powered on at idle were |
|
Row: #3786
So on the J473, deep-by-default still waits on #4226. Since the J413 passes, one way forward is to land the J413 default first, keyed on a DT property of the boards that have been tested, and keep the J473 on |
|
Row: #3786
Setup note: this J413 has a GTX 1080 in a Thunderbolt enclosure. With its drivers bound, every deep sleep is refused cleanly (the Mac stays up): With only nouveau blacklisted, the GPU's HDMI-audio function ( The J413 was restored to its saved default afterwards and verified. The J473 desktop still fails (#4226), as posted above. |
…ned PCIe-C
When deep sleep is the default mem_sleep mode on Apple Silicon Macs whose
deep sleep powers off CIO domains, a connected Thunderbolt device whose
PCIe-C functions cannot be removed cleanly before sleep (such as an eGPU
driven by nouveau, amdgpu, or snd_hda_intel, or an open external NVMe
disk) causes apple_cio_pm_notify() to refuse PM_SUSPEND_PREPARE with
-EOPNOTSUPP or -EBUSY. With s2idle as the default the same suspend
succeeds because the USB4 router and PCIe-C link stay powered across
s2idle.
Add a PM_SUSPEND_FLAG_FALLBACK_S2IDLE flag checked by enter_state() when
suspend_prepare(PM_SUSPEND_MEM) fails: if a notifier explicitly asked for
an s2idle fallback, retry suspend_prepare() as PM_SUSPEND_TO_IDLE with
PM_SUSPEND_FLAG_NO_PLATFORM set so the system suspends cleanly in s2idle
while keeping mem_sleep_current at deep for subsequent suspends once the
device is unplugged. Unflagged PM_SUSPEND_PREPARE errors are still
returned unchanged.
Add a non-destructive apple_pcie_tunnel_can_remove_orderly() pre-check
invoked from a priority-120 ACIO PM notifier (ahead of CD321x at 100 and
port teardown at 40) so sibling ports are never torn down before
discovering that another port must stay up. Also ensure the remaining
Apple PM_SUSPEND_PREPARE notifiers that test pm_suspend_default_s2idle()
respect pm_suspend_no_platform() for both explicit freeze and s2idle
fallback.
Add host tests and mutation negative controls in
tools/asahi/sleep-s2idle-fallback-tests.{c,py}.
Signed-off-by: Satya Benson <satya@benson.earth>
Add apple,sleep-tested to the 27.2 J413 (MacBook Air 13" M2) &sleep node so deep sleep is offered and selected by default without apple_sleep.deep=1 or apple_sleep.untested_commit=1, following the J414s/J613/J615 per-board pattern. Keep t8112_sleep_soc.untested set so J473 (Mac mini M2, where deep sleep commit resets in #4226), J415, J493, and legacy 13.5 J413 firmware stay on s2idle by default. Signed-off-by: Satya Benson <satya@benson.earth>
8c8cce3 to
1f7f71c
Compare
|
Rebased onto
Summary of changes:
Exact-head hardware verification on J413 (MacBook Air 13" M2, macOS 27.2 firmware, default cmdline, upstream Aura
Note: physical Thunderbolt eGPU hardware was not attached on this J413; the deep-refused -> |
There was a problem hiding this comment.
Verdict: MERGE at 1f7f71c
Checked: The existing sleep binding provides the boolean apple,sleep-tested. This head adds it only to the firmware-27 J413 DT and leaves the T8112-wide untested setting in place. The reported exact-head J413 row shows three committed deep wakes and one explicit s2idle cycle. The author also verified that the flag is absent in the legacy J413 and both J473 DTBs.
Checked: The non-destructive PCIe-C notifier runs before the PD and port-teardown notifiers. A retained device requests one retry at s2idle after the failed suspend preparation unwinds. Before the retry's notifiers, the core clears the original flags and sets the no-platform flag. The deep-only paths honor it and errors without the fallback flag return normally.
Checked: Ran the exact-head fallback harness locally. Its control passed for the retained eGPU, open disk, multi-port and other-error paths. It caught all four mutations covering the fallback branch, no-platform flag, unrelated refusal and notifier priority.
RyanTheTide
left a comment
There was a problem hiding this comment.
Approving at 1f7f71c. Review-bot approval at this exact head covers the code (deep only for J413 via apple,sleep-tested; J473 stays s2idle; PCIe-C deep-refused falls back to s2idle). Hardware: J413 3/3 committed deep + s2idle (27.2), J473 control. Adds the code-owner approval.
Brings the branch up to main after #3786 (s2idle fallback when deep sleep is refused for retained PCIe-C, J413 fw27 deep by default) and #3540 (thunderbolt: apple: lost-link recheck). Conflicts: - drivers/pci/controller/pcie-apple.c: both sides split the checks out of apple_pcie_tunnel_remove_orderly(). Main's helper, apple_pcie_tunnel_can_remove_orderly() and remove_orderly() are taken as they are. This branch's apple_pcie_tunnel_kept() and apple_pcie_tunnel_removable() stay for now; the next commit drops them. - tools/asahi/run-host-tests.py: both test entries kept. kernel/power/suspend.c merged without a conflict: the platform veto in pm_suspend() runs before enter_state(), and main's fallback in enter_state() still covers a deep sleep refused at PM_SUSPEND_PREPARE. Signed-off-by: DjDeveloperr <hey@djdev.me>
Main gained apple_pcie_tunnel_can_remove_orderly() with #3786: the same non-destructive check as this branch's apple_pcie_tunnel_removable(), with the same returns (0 when removable or already stopped, -EOPNOTSUPP for a driver the teardown doesn't remove, -EBUSY for a disk in use, -ENODEV/-EINVAL for no tunnelled host). Use it for the port's deep veto and drop the copy, so pcie-apple.c and pci-apple.h are main's again. The only difference is that the PCIe host now logs why the hierarchy stays, as it does when the teardown asks. Signed-off-by: DjDeveloperr <hey@djdev.me>
|
Post-merge receipt, J413 (MacBook Air M2, OS/system firmware 27.2): deep sleep PASS 3/3 on main
Evidence: |
What: Narrow the T8112 default deep-sleep flip to J413 (MacBook Air 13" M2, macOS 27.2 firmware) via the per-board
apple,sleep-testeddevicetree property—keeping J473 (#4226), J415, J493, and legacy 13.5 J413 ons2idleby default—and add an automatic fallback tos2idlewhen deep sleep is refused for a retained Thunderbolt PCIe-C tunnel (such as an attached eGPU or open removable disk).30eef1aaf6a8—PM: suspend: fall back to s2idle when deep sleep is refused for retained PCIe-C:PM_SUSPEND_FLAG_FALLBACK_S2IDLE(pm_set_suspend_fallback_s2idle()/pm_suspend_fallback_s2idle()) ininclude/linux/suspend.hand retry-as-PM_SUSPEND_TO_IDLEwithpm_set_suspend_no_platform()inkernel/power/suspend.c(enter_state()).apple_pcie_tunnel_check_removable()and exports non-destructiveapple_pcie_tunnel_can_remove_orderly()indrivers/pci/controller/pcie-apple.c+include/linux/pci-apple.h.apple_cio_pm_check_notify()pre-check (ahead of CD321x at 100 and port teardown at 40) plus a race-window fallback inapple_cio_sleep_teardown()indrivers/thunderbolt/apple.c.pm_suspend_no_platform()indrivers/gpu/drm/apple/dcp.c,drivers/pci/controller/pcie-apple.c,drivers/phy/apple/atc-t6050-combo.h, anddrivers/thunderbolt/apple.c.tools/asahi/sleep-s2idle-fallback-tests.{c,py}and registers them intools/asahi/run-host-tests.py.1f7f71c8cdf1—arm64: dts: apple: t8112-j413-fw27: Enable deep sleep by default:&sleep { apple,sleep-tested; };toarch/arm64/boot/dts/apple/t8112-j413-fw27.dts, leavingt8112_sleep_soc.untested = trueso other T8112 boards remain ons2idleuntil qualified.Rebased cleanly onto
main(7303d70ea68d).Tested:
LLVM=1kernel build +t8112-j413-fw27.dtb+ upstream Aura06c581d1Stage 2, noapple_sleep.*ormem_sleep_defaultoverrides) at1f7f71c8cdf1:/proc/device-tree/soc/sleep@23b700000/apple,sleep-testedpresent;/sys/power/mem_sleepas booted =s2idle [deep];apple-sleepreportssleep 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.rtcwake -d /dev/rtc1 -m mem -s 15) PASS (rc=0):boot object resumes 0 -> 1 -> 2 -> 3,wake source: NUB.SPMI0.SW33/3, device suspend0.522 s/0.495 s/0.489 s.s2idlefreeze (rtcwake -d /dev/rtc1 -m freeze -s 15) PASS (rc=0):PM: suspend entry (s2idle)->PM: suspend exit(0.316 s),suspend_stats/success:4,fail:0,mem_sleepremainss2idle [deep].O_DIRECTOK, Wi-Fi (wlan0) up, Borealis Vulkan (Apple M2 (G14G B0),Mesa 26.3.0-devel,/dev/dri/renderD128) active, live MTP keyboard + multi-touch + Force Click intact, 0 DCP crashes, 0 kernel panics/warnings/call traces, 0 failed units.1f7f71c8cdf1:make ARCH=arm64 LLVM=1 W=1clean;dtcconfirmsapple,sleep-testedpresent only int8112-j413-fw27.dtb(1) and absent int8112-j413.dtb(0),t8112-j473-fw27.dtb(0), andt8112-j473.dtb(0).1f7f71c8cdf1:sleep-s2idle-fallback-tests5/5 PASS (control + 4 mutations killed under bothgccandclang),run-host-tests.py --only sleep59/59 PASS,run-host-tests.py --only pcie10/10 PASS (includingpciec-policy-tests).scripts/checkpatch.pl --strict0 errors on both commits.8c8cce32b0e0and 50/50 deep sleeps on soc: apple: sleep, rtkit-helper: keep WAKE_SLP_DDR up for adopted DRAM buffers on T8112 #3774 (f27ce29f2ecad).Risk: two-way · J413 (macOS 27.2 firmware) and the PCIe-C deep-refused -> s2idle fallback path (
mem_sleep_default=s2idlecontinues to select s2idle; J473 stays on s2idle until #4226 is resolved; reverting restores the previous behavior).Not yet: Physical Thunderbolt eGPU hardware was not attached on this J413 (the eGPU and open-disk deep-refused -> s2idle fallback paths are verified by host + mutation tests in
tools/asahi/sleep-s2idle-fallback-tests.{c,py}andpciec-policy-tests.py, and are ready for a live check on a Thunderbolt eGPU J413); lid and AC-unplug wake rows.