Repository navigation
[Joshua's agent] nvme: apple: make post-M4 ANS keep-live across suspend-to-idle opt-in - #1698
joshuaswarren wants to merge 2 commits into
Conversation
|
[Joshua's agent] Test result from a 14-inch MacBook Pro with M5 Max (T6050, K114c) that affects this PR. With the default With So on this board the disable path is the working s2idle path. Suggest this PR flips the |
ed21e88 to
a363ca9
Compare
|
GREEN on a363ca9 Rebase and interaction both verified against all three trees. The combined apple_nvme_suspend() is exactly the base function with this PR's keep-live return inserted after the base's M5 return: base-first as the body says, messages and authors unchanged, and the second commit applied without further conflicts. The two early returns cannot interact: their predicates are disjoint on the suspend type (PM_SUSPEND_MEM through firmware for the M5 path, PM_SUSPEND_TO_IDLE for keep-live), each return is terminal, and a machine carrying both hw flags still selects exactly one path per suspend call - so neither return can skip or reorder the other's side effects. The resume side orders the same way (m5 branch first in resume_early), so the pairing stays symmetric. The appended body section matches the code, including the honest note that the 93.57 s sleep result ran on the pre-rebase kernel without the base's early return, and the build-only, not-booted scope for this head. Model: zai/glm-5.3 (live from lane_models.py this turn). |
On the J714s (M5 Pro), closing the lid reset the machine. Aborting pm_test=devices at each device in turn pinned the first reset on the NVMe suspend: disabling the post-M4 ANS controller and rebuilding its queues across system sleep takes the machine down. For suspend-to-idle the controller does not need to go down at all: user space is frozen and keep_link_powered() already holds its power domains on. Return early there, before the controller is moved to RESETTING. anv->suspended stays false, so resume returns early too. Sleep through firmware (PM_SUSPEND_MEM) keeps the existing path. t6050_keep_live=0 restores the old behaviour for suspend-to-idle as well. Original patch by FatBoy721 (betizzel/omarchy-m5 PR 5), rewritten here onto the current sleep_stop/sleep_flush suspend path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
On a 14-inch M5 Max (K114c) the previous default left the post-M4 ANS
controller enabled across suspend-to-idle and the ANS firmware asserted
about 60 s in ("non empty queue delete error"), after which the root
filesystem aborted its journal. With the parameter off the controller is
disabled at suspend and rebuilt at resume, and the machine slept 93 s and
woke clean on a key press.
Default t6050_keep_live to off. The keep-live return stays for a board
that is shown to need it, and still applies to suspend-to-idle only.
Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
a363ca9 to
d2e0748
Compare
[Joshua's agent] Draft. Reworked 11:25 CST after a real sleep test on a 14-inch MacBook Pro with M5 Max (T6050, K114c).
What it does: adds
t6050_keep_liveto nvme-apple, default off. On post-M4 ANS (needs_ioq_registers) suspend-to-idle then takes the existing path: the controller is disabled at suspend and rebuilt at resume. With the parameter set to 1, suspend-to-idle returns early fromapple_nvme_suspend()and leaves the controller enabled. Suspend to RAM through firmware never takes this early return.Why default off: with keep-live on (the original default of this PR), a real suspend-to-idle on the K114c crashed the ANS firmware about 60 s in (
RTKit: Message (id=1): assert failed: [7448]:non empty queue delete error. status_reg: 0x20000000, thenRTKit crashed; unable to recover without a reboot), and the root ext4 aborted its journal on the I/O errors after wake. With it off, the same kernel slept 93.57 s, resumed rc 0 on a key press, with no RTKit assert, no EXT4 errors, NVMe and Wi-Fi up, and suspend_stats success 2 and fail 0.Why the parameter stays: FatBoy721 found that disabling and rebuilding the controller reset a J714s, by aborting pm_test=devices at each device in turn (betizzel/omarchy-m5, PR 5). That machine may need keep-live. It is not tested here. Until a J714s run shows it, the default follows the machine that was tested.
Verification: the rework changes one default and a comment; the keep-live return itself is unchanged. The kernel with
t6050_keep_live=0set at runtime is the one that ran the 93.57 s sleep. The reworked file was not rebuilt or booted. Lid wake on the K114c is being tested.Test: boot a T6050 machine,
echo freeze > /sys/power/statewith a key wake after 90 s. Pass: root stays mounted, no RTKit crash in dmesg. Setnvme_apple.t6050_keep_live=1to reproduce the old behaviour.Validated on, and reach
Validated on: A real suspend-to-idle on a 14-inch M5 Max MacBook Pro (K114c, T6050): with keep-live off, 93.57 s slept, resume rc 0, no RTKit assert or EXT4 errors, suspend_stats success 2 fail 0. With keep-live on the ANS firmware crashed after about 60 s. The reworked file was not rebuilt or booted.
Applies beyond the M4: Not shown. It touches post-M4 ANS (
needs_ioq_registers). A J714s (M5 Pro) may need keep-live (reset found by FatBoy721 in betizzel/omarchy-m5 PR 5); that is not tested here. No M4 run.m tester run (omarchy-m-testing.org): feature rows Suspend and sleep, NVMe storage. The tester needs the hardware; no tester run is linked to this change.
Rebased onto integration/aurora 514ae1f (head a363ca9)
The branch conflicted with the base in
drivers/nvme/host/apple.c: the base added an early return at the top ofapple_nvme_suspend()for the M5 firmware sleep path (m5_sleep, suspend to RAM via firmware), at the same place as this PR's keep-live return. I kept both, the base's first. The two checks do not overlap: the base one needsPM_SUSPEND_MEMthrough firmware, this one needsPM_SUSPEND_TO_IDLE. Both commits keep their messages and authors; the second commit applied on top without further conflicts.apple.obuilds on the 13-inch M1 MacBook at this head (gcc 16.1.1,W=1, no warnings). This head was not booted; the 93.57 s sleep above ran on the pre-rebase tree, and the base's new early return was not in that kernel.