Repository navigation
T6050: firmware-driven deep sleep on the K116s (16-inch M5 Pro, firmware 27.2) - #2201
Conversation
1e538de to
dda6aa0
Compare
|
Thanks for putting the 27.2 sleep together as one series; the testing write-up is very useful. Our convention is to select behaviour by a hardware or firmware property, not by the list of boards it was tried on, and the admissions extend those lists with Two of them carry firmware behaviour: the ANS log buffer under the hold ( For the admissions, could the SoC sleep data or a DT property on each node (for example the sleep description itself) select them? A generic name instead of |
|
Thanks for putting this together as one series. #2075's findings are all covered here. A review note on how the new behaviour is selected, before this merges. Most commits add
None of this changes what the K116s does at runtime. It changes which other T6050 boards pick it up. |
|
One addition to the notes above, so the hardware side is clear as well. The 30 s RTC sleeps cover the alarm path; the series also makes lid and keyboard wakes possible (
On the selection point: #2089 changes the T6050 sleep entry's machine string to The rtkit, dcp and |
dda6aa0 to
ea096dd
Compare
|
Ryan, thanks for the review. The series is reworked along those lines; the branch is force-pushed as v2. Nothing in it names the K116s in a driver any more, and the K116s does the same things at run time as before. How the paths are selected now
What this changes on other boards
Where I would like your view
Checks checkpatch is clean except the Test row K116s, firmware 27.2. Kernel for the first two items:
Since 2026-11-16 the journal has 113 deep-sleep wakes on this machine across the heads of this work: 75 by RTC alarm, 17 by the lid, 18 for the charger, 2 for Wi-Fi/Bluetooth and 1 by the power key. |
|
Thanks for v2, this is a big step: the board lists are gone from most drivers, the PMP CoreAnalytics ack now follows
Row still open at the v2 head on the K116s: three lid close/open sleeps with no alarm armed and three power-key wakes, each with the same post-resume checks as your rtcwake runs. Bluetooth can stay out since the machine does not use it. Thanks for the charger-wake numbers; we will look at the dark-wake series when it is up. One more K116s row, beyond this PR: SIO is still enabled only on the J714s ( |
ea096dd to
4a72ae6
Compare
|
Ryan, thanks. v3 is pushed; point by point: 1. One predicate.
One thing I left: 2. SMC wake reasons. 3. Wake mode set. Two completions in place of the poll and the
A wait that runs out logs a warning and the mode set is sent anyway. In three v2 wake logs the report follows the open by 5 to 16 ms. One caveat: the 40 ms also covered about 20 ms of firmware set-up that follows its hotplug notify in the syslog, so this sends the mode set earlier than v2 did. At the v3 head neither wait ran out in five wakes, and the panel was on after each; in the one I timed the report came 5 ms after the open and the mode set request followed at once. 4. 5. SPMI, tipd.
What changes on other boards, v3 against v2
Checks
Tests at the v3 head (K116s, firmware 27.2,
I did one lid and one power-key wake, not three of each, on purpose. The sleep and wake path does not depend on what wakes the machine, and everything v3 changes in it ran in the Link the SIO branch when it is up and I will boot it and post the two logs. |
|
Thanks for v3; one predicate, the wake reasons in the DT, the completions, and failing the unacknowledged idle all read right. On your question: yes, please give |
|
Ryan, thanks. v4 is pushed: three commits on top of v3, nothing else changed. The merged-mode limit. USB-C re-enumeration. One Checks on v4. Builds; checkpatch clean on the three commits; Sequencing. #2440, #2441 and #2442 cover the selection commits here with the same helper. If they go first, I will rebase this onto them and drop the duplicates, which leaves the 27.2 pieces, the bindings and the K116s tree. Say which order you want. |
|
As promised, the branch that widens SIO and the PMP CoreAnalytics acknowledgement from the J714s to every T6050 board (keyed on the hardware instead of the board name) is #2412 (draft). A boot of it plus |
|
Note 🤖 Claude Opus 5.5 responding on behalf of Isaac-Duarte J714s row for 3a8aaee ("a sleep with no RTC alarm armed is not refused") alone: lid close deep-sleeps, 2 of 2, woken by the lid. Setup: J714s (14" M5 Pro), system firmware 27.0. Kernel Before (same tree without the commit): each lid close is refused at entry, and logind retries about every 30 s while the lid stays shut: With the commit:
No early wakes and no RTC alarm armed in either. Battery on the 2 h 28 min sleep, on battery throughout: 97.245 % → 96.753 % (upower), about 0.32 Wh of a 65.5 Wh full charge, so roughly 0.13 W average while asleep. Not covered: a power-key wake, and a USB-C plug wake with the lid shut (#2231 is not in this tree). RTC-alarm sleeps ( Could this commit go up as its own PR? It's the only thing a J714s needs from this series for lid-close deep sleep, and here it doesn't depend on #2187/#2309 or the K116s commits. If you'd rather not split it, I can open one with you as the author. |
|
@Isaac-Duarte thank you for the J714s row on 3a8aaee on its own. Lid-close deep sleep refused at entry without it and 2 of 2 with it, both woken by the lid with Wi-Fi, Bluetooth and speakers back, is a clear before and after, and the 0.13 W average on the long sleep is a useful number. Noted that power-key and USB-C plug wakes are not covered yet. |
965c1b5 to
ddbc973
Compare
|
v5 is up at ddbc973, rebased onto
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH at a01d61c1f397
Blockers: none
Checked: Full semantic interdiff from 6fd4b798070e to a01d61c1f397, full 35-commit diff against main (d420ae2bd61a), both dcp-v27-sleep.inc race fixes and both prior nits, §1–§6 compliance, exact-head CI (13/13 green), exact-head K116s hardware evidence, and dependency PR state (#2187, #2309, #2877).
Evidence
- Prior blockers and nits resolved cleanly:
drivers/gpu/drm/apple/dcp-v27-sleep.inc:1363-1364,1454-1459:dcp_secure_poll_stop(dcp)moved out ofdcp_v27_sleep_prepare()to the end ofdcp_v27_late_arm()(process context, only after all arm steps succeed), anddcp_v27_late_disarm(..., stopped=false)restarts it viadcp_secure_poll_start(s->dcp). Refusals during prepare or aborts before arm leave the poller running; aborts after arm restore it cleanly. Verified on K116s with apm_testplatform cancel-after-arm between deep sleeps.drivers/gpu/drm/apple/dcp-v27-sleep.inc:73-77,1227,1260:dcp_v27_wake_expect(dcp)now callsreinit_completion(&dcp->v27_wake_video)andreinit_completion(&dcp->v27_wake_hotplug)beforeiomfb_v27_sleep_rpc(dcp, false, true)and again beforeiomfb_v27_sleep_plain(dcp, true), removing the post-power-on reset race.drivers/soc/apple/rtkit-v27-late.inc:166-167:apple_rtkit_v27_port_ap_idle_atomic()now checksFIELD_GET(APPLE_RTKIT_MGMT_PWR_STATE, in.msg0) == APPLE_RTKIT_PWR_STATE_IDLE ? 0 : -EPROTO.arch/arm64/boot/dts/apple/t6050-k116s-sleep.dtsi:264: stale live-DT-mutation comment updated.
- Checklist (§1–§6):
- §1 No model gating: Pass (
apple_t6050_sleep_described(),apple,display-method-sleep,apple,merged-mode-limit,apple,wake-reasons, and method-table admission; only pre-existingmainJ714s dark-wake rule / old-DT fallback remains inmacsmc.c). - §2 Production-ready: Code clean (no new cmdline/module params or hacks). Note K116s hardware row still used non-default cmdline (
idle=nop). - §3 Safety: Pass.
- §4 Clean-room & attribution: Pass (35/35 commits carry human author/committer and human
Signed-off-by:; clean commits, PR title, and PR body). - §5 Evidence & CI: 13/13 active CI checks green at
a01d61c1f397(MERGEABLEontomain); exact-head K116s row present (4 deep sleeps + 1pm_testplatform cancel-after-arm, 0 SELinux denials, 0 failed units, 0 error-level kernel lines at boot, 0 new kernel errors at wakes, no wake-report timeout, no secure port warning). - §6 Naming: Pass (
aura, nom1n1orHoneykrisp).
- §1 No model gating: Pass (
- Remaining before merge (external prerequisites):
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at a01d61c1f397: the code point is fixed; it needs a branch update and one more row.
Blockers: none in the code. The secure poller is now stopped only once the sleep is armed (end of dcp_v27_late_arm()) and restarted on disarm, so a refusal in dcp_v27_sleep_prepare() leaves it running (v11, a01d61c1). The branch conflicts with main again; update it. After the update, the K116s rows still apply if the touched files merge without changes. Missing row: this touches code every Mac runs (apple-dart.c, irq-apple-aic.c, macsmc.c, pcie-apple.c, dwc3-apple.c, g17/sleep.c), so before it merges it also needs one boot at the updated head on a non-M5 Mac with an s2idle cycle and no new kernel errors. We'll run it on our J773g or J700.
Checked: no Apple material. The T6050 paths are selected by the sleep's own description, not the board. Host tests 503/503, display selftests 94/94.
Superseded by the review at a01d61c
Conflict in drivers/mfd/macsmc.c: keep both sides' new helpers (apple_smc_dt_wake_reasons() here, the WKTP full-wake ones from main), and in apple_smc_dark_wake() take main's order (an already-dark wake is counted first, on every board with a sleep policy) with this branch's port_dark_wake test in place of the J714s wake-reason table compare. Signed-off-by: Dj <[email protected]>
satchlj
left a comment
There was a problem hiding this comment.
Gemini 4 Neon on @satchlj's behalf
Verdict at 2b65b5180834
Approve — clean, well-factored generalization of T6050 firmware-driven deep sleep to DT-described boards (replacing hardcoded board lists) and firmware 27.2 K116s support, with 12/12 CI checks green.
Blockers
None for code review.
Note on merge readiness: As flagged by pr-readiness, an exact-head K116s hardware row at 2b65b5180834 is still owed before merge (prior K116s hardware verification was on v11 a01d61c1f397 before the final rebase).
Checked
- Full static audit of all 35 changed files (
+843/-94):include/linux/soc/apple/sleep.h+ callers (irq-apple-aic.c,macsmc.c,apple-m5-sleep.h,pcie-apple.c,atc-t6050-combo.h,dwc3-apple.c,apple-dart.c,apple-dart-v27-admission.inc,asahi/g17/sleep.c,dcp.c,sleep.c): replaces scatteredj714s/j716cboard-compatible checks withapple_t6050_sleep_described()/apple_t6050_sleep_property("apple,display-method-sleep")(checkingapple,t6050+ availableapple,t6050-sleepnode) while preservingport_dark_wakescoping strictly toj714s.drivers/soc/apple/mailbox.c+rtkit.c+rtkit-v27-late.inc+drivers/gpu/drm/apple/dcp.c+dcp-v27-sleep.inc:apple_mbox_get_prop()/apple_rtkit_init_mbox_prop()cleanly supportapple,secure-mboxwithout disturbingmboxeshandoff expectations.apple_rtkit_idle_strict_with()andapple_rtkit_v27_set_after_ap()/apple_rtkit_v27_port_ap_idle_atomic()execute secure-port AP idle between main AP idle ACK and IOP idle (both normal and interrupts-off atomic paths), failing/poisoning on error and restarting secure polling when!stoppedon disarm.apple_rtkit_alloc_first_shmem()allows first-time endpoint buffer allocation duringans_holdwithout replacing existing buffers.
drivers/gpu/drm/apple/epic/panelavep.c,iomfb_template.c,iomfb_v27.c: boundedv27_wake_video->v27_wake_hotplugwaits for firmware 27.2 renumbered methods before modeset, with clean completion init at probe and timeout warnings.drivers/mfd/macsmc.c+macsmc-test.c: DT-drivenapple,wake-reasons/apple,wake-reason-namesparsing validates equal lengths,bit <= 63, and cleanly falls back to static tables if absent/invalid.- DT / bindings / KUnit updates: clean and consistent across all files.
- CI at
2b65b5180834: 12/12 checks SUCCESS (kunit,dt-checks,host-tests,source,readiness,pr-text,rust-build, DWC3/ATC matrix). - Untested scope: no local K116s hardware suspend/resume run performed (static diff + CI verification only; exact-head K116s row at
2b65b5180834remains owed).
Evidence
- Changed files (35):
+843/-94. - CI: 12/12 checks green at
2b65b5180834. pr-readinessconfirms no conflicts, CI ok, PR text ok; awaiting code-owner review and exact-head K116s hardware row at2b65b518.
|
The approved |
Keep the struct resource forward declaration added on main alongside the <linux/of.h> include and apple_t6050_sleep_property() helpers in include/linux/soc/apple/sleep.h. Signed-off-by: Diljit Singh <[email protected]>
satchlj
left a comment
There was a problem hiding this comment.
Gemini 4 Neon on @satchlj's behalf
Verdict at 478fb58a902c
APPROVE — clean merge of main (e7528180365f) into the previously approved 2b65b5180834 head, preserving the struct resource; forward declaration in include/linux/soc/apple/sleep.h with zero unintended changes to the reviewed sleep paths, and all 13/13 active CI checks pass.
Blockers
None.
Checked
- Changed files (35 files,
+843/-94): Verified merge commit478fb58a902c(parents: 2b65b5180834, e7528180365f,Signed-off-by: Diljit Singh <[email protected]>) resolves only theinclude/linux/soc/apple/sleep.hheader conflict cleanly (retainingstruct resource;alongside<linux/of.h>andapple_t6050_sleep_property()/apple_t6050_sleep_described()). - CI (13/13 active checks passing, 1 skipped, 0 failing, 0 pending):
Device tree checks/dt-checks: PASS (13m53s)Host tests/host-tests: PASS (7m18s)SEP source checks/kunit: PASS (10m32s)MT7932 KUnit/kunit: PASS (5m40s)Apple DRM KUnit/kunit: PASS (4m50s)PMGR power state KUnit/kunit: PASS (4m18s)SEP source checks/rust-build: PASS (3m31s)SEP source checks/DWC3/ATC(×3): PASSSEP source checks/source: PASSpr-readiness/readiness: PASSpr-text/pr-text: PASS
- Untested scope: Live Apple M5 Pro (K116s, firmware 27.2) suspend-to-RAM hardware validation (carried by PR owner's hardware test rows).
Evidence
- Merge commit
478fb58a902c614c613eacfd7a52bf1ae38b94b7:- Parents:
2b65b5180834f3352a2566c632452a632d88f757(previously approved head) ande7528180365f06cd40aca475f5bfb3a6180c68c2(main). include/linux/soc/apple/sleep.h: retainsstruct device;,struct resource;,#include <linux/of.h>,apple_t6050_sleep_property(), andapple_t6050_sleep_described().
- Parents:
gh pr checks 2201 -R aurora-silicon/linux:0 cancelled, 0 failing, 13 successful, 1 skipped, and 0 pending checks.
|
J773g (T8132, Apple M4, G16G B0)
|
Problem
The K116s (16-inch MacBook Pro, M5 Pro, T6050) on firmware 27.2 has no system sleep. The T6050 firmware-driven deep sleep in
mainis selected by board lists (J714s, J716c) and is written against firmware 27.0: on 27.2 the internal display coprocessor has a secure mailbox port that must go idle before the coprocessor takes its own idle, and the display calls are renumbered (#2187).Change
With this series the K116s enters the deep sleep and wakes by RTC alarm, lid, power key or keyboard, with panel, NVMe, Wi-Fi and Bluetooth back. It is stacked on #2187, which brings the 27.2 call numbering and sleep transport: the first three commits here are #2187's, carried unchanged, and drop out when it merges. The 32 after them are this series.
Affects every T6050 machine that describes the sleep in its device tree: J714s and J716c as before, now selected by that description instead of by name, and the K116s, which the last commit enables. No board, chip or firmware-version gate is added; the remaining J714s check in
macsmc.cis the one already inmain.Firmware 27.2 pieces
dcp-exclave-mailbox). While nothing answers it, the firmware acknowledges the AP idle and never the IOP idle. The port's AP idle now goes between the two, at the late stop and in the wake's stop/restart cycle. RTKit gets a hook for that step (apple_rtkit_v27_set_after_ap(),apple_rtkit_idle_strict_with()); a port idle that is not acknowledged fails the idle. Where the port is named byapple,secure-mbox, RTKit takes its mailbox from that property.Selection by the sleep's description
A helper tells whether a T6050 machine describes the sleep in its device tree (an enabled
apple,t6050-sleepnode), and the drivers use it in place of their board lists: sleep controller, AIC, SMC, RTKit (PMP), SIO, NVMe, PCIe, DART, the combo PHY, dwc3, the GPU, and the display driver. The CPU topology check uses the CPU inventory alone.Device tree and bindings
The PMU's RTC, the video encoder's power states (VENC0_SYS left on by iBoot blocks the sleep), an
#ifndefso a board without the USB4 router can include the J714s's SoC values, and the K116s sleep description. Only the last commit enables the sleep.Testing
Tested: K116s (T6050, M5 Pro), firmware 27.2; rows below. Host tests 503/503 and display selftests 94/94 at the head.
Risk: two-way · T6050 machines that describe the sleep (J714s, J716c, K116s). Shared drivers are touched (AIC, SMC, RTKit, SIO, NVMe, PCIe, DART, combo PHY, dwc3, G17, DCP); on other SoCs the changes are behind the T6050 sleep description.
a01d61c1f397T6050 / K116s (M5 Pro), firmware 27.2: booted on a stack that contains these 35 commits unchanged (main35cfd76 + drm/apple: J716c external displays and display sleep on firmware 27.2 #2187 + T6050: firmware-driven deep sleep on the K116s (16-inch M5 Pro, firmware 27.2) #2201 v11 + spmi: apple: recover every generation 4 controller from a failed exchange #2309 + wifi: apple: centauri: t6050: harden keep-alive sleep fallback, PME gating, and 27.2 TLV 280 #2877 + T6050 sleep: two lock checking reports at the first deep sleep #3065 + wifi: apple: centauri: attach the Beta function outside the rescan lock and boot_lock #2206 + my other K116s commits,7.3.0-m5pro-ge075a92be4cc); 4 deep sleeps resumed on the same boot (two rawrtcwake -m memwith Wi-Fi associated, one logind suspend with an RTC alarm, one rawrtcwake -m memwith Wi-Fi disconnected) and one suspend cancelled after the arm (pm_testplatform) between them, panel and Wi-Fi back each time; 0 SELinux denials (not installed on this Debian), 0 failed units, 0 error-level kernel lines at boot, 0 new kernel errors at the wakes, no wake-report timeout and no secure port warning.The K116s does not sleep without #2187, #2309 and #2877, so every row is on a stack, named in the row. The command line is not the default (
idle=nopamong others).Earlier rows, by head
K116s, firmware 27.2. Kernel:
integration/aurora+ #2187 + #2309 + this series + my other K116s commits.rtcwake -m memwith Wi-Fi associated, a logind suspend with a 35 s RTC alarm, and a rawrtcwake -m memwith Wi-Fi disconnected by hand.rtcwake -m memwith Wi-Fi associated. Resumed on the same boot with panel and Wi-Fi back; the secure port came up through the new lookup, and the sleep and the wake logged no idle failure.rtcwake -m memwith Wi-Fi disconnected by hand also resumed.Still to run
J714s and J716c: not run here, I have neither. What changes on them: a first buffer under the ANS hold is served, the J716c acknowledges the PMP's empty CoreAnalytics event, a J714s on 27.2 would take the wake's mode set, and both take the secure-port and strict-idle paths only if their device tree names the port.
Standalone on
main+ drm/apple: J716c external displays and display sleep on firmware 27.2 #2187 the series builds; it has only been run as part of the stack above.Reset with Wi-Fi associated at entry. At the v6 head a raw
rtcwake -m memwith Wi-Fi still associated reset the machine, 2 of 2. wifi: apple: centauri: t6050: harden keep-alive sleep fallback, PME gating, and 27.2 TLV 280 #2877 takes the warm-reset path instead of wifi: apple: centauri: t6050: keep N1 firmware, Bluetooth, and Wi-Fi alive across deep sleep #2718's keep-alive entry when the stack disconnected inside suspend, and with it on top of the v6 stack the same sleep resumes, 2 of 2 (rows in wifi: apple: centauri: t6050: harden keep-alive sleep fallback, PME gating, and 27.2 TLV 280 #2877). Until that is in, a sleep through logind is not affected, since NetworkManager takes Wi-Fi down first.AOP crash. One AOP coprocessor crash (
exception.c:59) in 1 of 38 wakes. Not understood.Charger wakes. A port's wake with the lid closed is a dark wake since soc: apple: sleep, mfd: macsmc: T6050: a port's wake with the lid closed is a dark wake #2445. With the lid open it is a full wake.
Wi-Fi line at entry.
apple_centauri_t6050 0000:01:00.0: firmware country update failed: -125as the suspend starts, at the RTC-alarm sleep of the v5 run and in 60 of my 64 saved alarm-sleep logs since 2026-11-16; not at the four lid entries of that run. A country update is in flight when Wi-Fi is stopped and is canceled. It is the Wi-Fi driver's, not this series', and Wi-Fi is back after the wake each time.Thunderbolt. The CIO sleep part is not enabled on this board; no USB4 router is described.
Other boards. Not tested on a J714s or J716c beyond building. What changes there is listed in the v2 comment: a first buffer under the ANS hold is served, the J716c acknowledges the PMP's empty CoreAnalytics event, and a J714s on 27.2 would take the wake's mode set.
Bindings.
apple,secure-mboxnames the DCP's secure port apart frommboxes, because the boot loader hands the display over only to a node with a single mailbox. Its binding is added here, with the T6050 secure port's compatible and the empty form ofapple,pinctrl-skip-pins.Revision history
v11 (2026-11-24): rebased onto
main35cfd76, no conflicts. The secure port's poller is stopped once the sleep is armed instead of at.prepare, and started again when a sleep is disarmed without the firmware having stopped, so a refused or cancelled sleep no longer leaves it off. The wake's two completions are reset before the calls that power the panel on.apple_rtkit_v27_port_ap_idle_atomic()checks that the acknowledged state is idle. A stale comment int6050-k116s-sleep.dtsiis corrected.v10 (2026-11-24): rebased onto
main974efa5. One conflict, inrtkit.cagainst the adopted-session argument of__apple_rtkit_init(); no other change.v9 (2026-11-23): rebased onto
integration/aurora1b1304f and #2187's new head a56f2a5. One conflict, int6050-k116s.dtsagainst #2204 and #2214, which merged; both sides kept. No other change to the commits of this series. It builds, host tests 463/463, display selftests 94/94. Booted: see Testing.v8 (2026-11-23): rebased onto
integration/aurora70a00e5 and changed after review:apple_mbox_get_prop(),apple_rtkit_init_mbox_prop()), and the DCP uses that forapple,secure-mbox. Theof_update_property()export is gone.apple_rtkit_idle_strict_with()takes a callback that returns an error, and a secure port idle that is not acknowledged fails the idle.v7 (2026-11-23): rebased onto
integration/aurora160ca43. No change to the commits of this series. #2187's three commits are carried as before; their head conflicts with the tip in two selftest files (apple-dcp/boot.py,run.py), resolved here by keeping both sides. Not booted at this head: it builds and the host tests pass (463/463).v6 (2026-11-22): rebased onto
integration/aurorabb9f8ec and #2187's new head 7375b71. Three commits left: the no-alarm commit (in through #2698), the<ctype.h>test fix (#2187 no longer needs it) and the A492 filler commit (#2187 now zeros the filler itself). Nothing else changed.v5 (2026-11-21): rebased onto
integration/auroraa84637d. The port controllers' side of the USB commit is in through #2640, so that commit is the dwc3 line alone, and the K116s's three controllers ask forapple,sleep-ssps-rulesandapple,reset-on-failed-probe. The saved-context commit keeps the J714s's wake table (#2231 selects by it).v4 (2026-11-19): the merged-mode limit gets its own property on the external display coprocessors (three commits on top of v3).
v3 (2026-11-19): second round of review: one predicate, the SMC wake reason names in the device tree, the wake mode set on firmware events, our SPMI commit dropped for #2309. v2 removed the board lists. See the comments below for what changed.