Repository navigation
T6050: a "freeze" with mem_sleep at deep is a suspend-to-idle (no dock teardown, no -67) - #2510
Merged
DjDeveloperr merged 4 commits intoNov 20, 2026
Conversation
PM_SUSPEND_PREPARE notifiers run before suspend_devices_and_enter() sets pm_suspend_target_state and PM_SUSPEND_FLAG_NO_PLATFORM, so a notifier cannot tell a "freeze" from a platform sleep. The Apple drivers that prepare a firmware sleep in their notifier (USB hosts stopped, a USB4 port powered off, a PCIe port parked) ask pm_suspend_default_s2idle() instead, which only says what "mem" stands for: with mem_sleep at deep, a "freeze" gets the whole firmware-sleep preparation. Set the flag in enter_state(), right after the flags are cleared and before the notifiers. Nothing reads it in between today: every other reader is a device or platform callback, which runs after the later set. That set stays for the callers of suspend_devices_and_enter() that skip enter_state(). The T8140 bootstrap's notifier had a comment on the flag being unset there; it vetoes nothing in the notifier either way. Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
…the default The PM notifiers take a sleep for a firmware sleep from mem_sleep alone. With mem_sleep at deep a "freeze" is still a suspend-to-idle, but the notifiers released the displays behind the port, removed the tunnelled PCIe functions and powered the port off for it. On a J714s with a dock on the left front port (acio1, which has no sleep in place) that cost the dock's USB4 link for a sleep that never needed it: thunderbolt-apple-acio 2a9ac0000.acio: T6050 sleep: 3 display request(s) behind this port ended in 214 ms thunderbolt-apple-acio 2a9ac0000.acio: powering off port for system sleep (cable info 0x801) thunderbolt 0-1: device disconnected thunderbolt-apple-acio 2a9ac0000.acio: restarting port after system sleep thunderbolt-apple-acio 2a9ac0000.acio: T6050 sleep: router firmware reports lane init action 0 (a cold start) ... Timeout for at_rt command response expired!!!. register=12 The suspend core's flag now says at the notifiers that the sleep is a suspend-to-idle. Ask it in the two decisions made at PM_SUSPEND_PREPARE, the port's power-off and the displays' release ahead of it: the port then stays up with its tunnels, as it does with mem_sleep at s2idle. apple_cio_t6050_sleep() itself is left alone. The power-off also runs from a work, for a sleep given up with the displays released, and reads it several times on the way: a "freeze" written while that work runs would change the answer under it. A suspend-to-idle written before that work has started is refused (-EBUSY) ahead of the freezer, and the work is left to bring the displays back: unlike a firmware sleep it does not power the port off and restart it, so it cannot take the owed undo over. Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
The PM notifier takes the sleep for a firmware sleep whenever mem_sleep is at deep, and stops the running hosts it does not keep in place for it. A "freeze" with mem_sleep at deep is a suspend-to-idle: the controllers keep their power, and their hosts were removed and every device enumerated again for nothing. On a J714s a webcam that had just been through that (046d:0943 on the right port) stopped answering control requests 0.3 s after its new enumeration. Ask the suspend flag too, which now says at the notifiers that the sleep is a suspend-to-idle: the host then stays, as it does with mem_sleep at s2idle. Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
The PM notifier parks the SD card reader's port ahead of a firmware sleep whenever "mem" stands for deep. A "freeze" entered with that default is a suspend-to-idle all the same: the host's noirq callback then runs the adopted link's s2idle check, finds the parked port's link down and refuses the suspend: pcie-apple 1cb0000000.pcie: PM: dpm_run_callback(): apple_pcie_suspend_noirq returns -67 pcieport 0000:00:01.0: Unable to change power state from D3hot to D0, device inaccessible Seen on a J714s with mem_sleep at deep and "rtcwake -m freeze", and on a K116s tree that describes the sleep (the K116s row on aurora-silicon#2441). The suspend core now marks a suspend-to-idle before the notifiers run: leave the port alone then, as with mem_sleep at s2idle. Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
DjDeveloperr
merged commit Nov 20, 2026
61295c2
into
aurora-silicon:integration/aurora
7 checks passed
Contributor
|
Merged as Review (independent, code only): no blocking issue.
CI is green, including kunit, rust-build and the DWC3/ATC configs. Notes for a follow-up (none blocking):
Update 00:45: the local object compile has now passed. All touched objects built with the M5 asahi config at W=1 with no compiler warnings, on integration |
This was referenced Nov 20, 2026
This was referenced Nov 20, 2026
Draft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
mem_sleepatdeep, writingfreezeto/sys/power/state(rtcwake -m freeze) on a T6050 with a sleep profile got the whole firmware-sleep preparation and was then refused with -67. On my J714s it also cost the dock its USB4 link. Now afreezeis treated as the suspend-to-idle it is, whatevermemstands for.Why
The drivers that prepare a firmware sleep before the freezer do it in their
PM_SUSPEND_PREPAREnotifiers: the USB hosts are stopped (dwc3-apple), a USB4 port without a router sleep in place is powered off (thunderbolt), the SD card reader's port is parked (pcie-apple). They decide withpm_suspend_default_s2idle(), which says whatmemstands for, not which state was written.pm_suspend_target_stateandPM_SUSPEND_FLAG_NO_PLATFORMare set insuspend_devices_and_enter(), after the notifiers, so a notifier cannot tell afreezefrom a platform sleep.So a
freezeunderdeepwas prepared as a deep sleep and entered as s2idle, where the PCIe host's adopted-link check found the parked port's link down:axboe saw the same refusal on the K116s, 3 of 3 (his row on #2441). On the J714s, with a TB5 dock on the left-front port, the port's cold restart after the refused freeze did not get the USB4 link back (
Timeout for at_rt command response, register 12, nothunderbolt 0-1: new device found): the dock was a USB2 hub from then on. A USB camera on the right port stopped answering control requests after it too.What
Four commits:
enter_state()setsPM_SUSPEND_FLAG_NO_PLATFORMfor a suspend-to-idle right after the flags are cleared, before the notifiers (kernel/power/suspend.c, +3). The later set insuspend_devices_and_enter()stays for the callers that skipenter_state(). A comment in the T8140 bootstrap that described the flag as unset in its notifier is brought up to date; that notifier vetoes nothing either way.PM_SUSPEND_PREPARE, the port's power-off (apple_cio_sleep_tears_down()) and the displays' release ahead of it (apple_cio_sleep_dp_entry()), are "no" for a suspend-to-idle: the port stays up with its tunnels.sleep_deepis false for a suspend-to-idle: the hosts stay.Each driver change is a test of
pm_suspend_no_platform()at the notifier's decision. A deep sleep (memunderdeep) and an s2idle undermem_sleep=s2idletake the same branches as before.The thunderbolt test is not in
apple_cio_t6050_sleep()itself: the power-off also runs from a work, for a sleep given up with the displays released, and reads that predicate several times on the way, so afreezewritten while the work runs would change the answer under it.One refusal is new: a suspend-to-idle written while such an undo is still owed (the sleep was given up, its work has not started) gets -EBUSY ahead of the freezer, and the work brings the displays back. A firmware sleep takes the undo over, since it powers the port off and restarts it; a suspend-to-idle cannot. Before, an s2idle there dropped the undo and the displays stayed off until a replug.
Tested
J714s (14-inch M5 Pro), kernel 0abc2f3 plus my carried PRs, these four commits, #2144 and #1996.
freezeunderdeep, nothing on the portsfreezeunderdeep, TB5 dock on left-front (three tunnelled displays, tunnelled PCIe, Ethernet)memunderdeep), five in one bootmemunders2idle) after thoseThe runs above had the thunderbolt test inside
apple_cio_t6050_sleep(); it moved to the twoPM_SUSPEND_PREPAREdecisions in review. The dock row was run again with this PR's head (the same dock, three displays, tunnelled PCIe and Ethernet on left-front): the same result, no port power-off, no xHCI removal, no parking, the NHI's refusal, and the displays, Ethernet and an identical USB tree back 4 s after the entry. The new refusal has not been exercised: no sleep was given up with the displays released.Host tests pass (
tools/asahi/run-host-tests.py, the whole set, merged onto 1473d15).Not changed
combo_pm_notify), the display's (dcp_s2r_pm_notify) and the T8140 PCIe notifier (apple_pcie_neo_pm_notify) still askpm_suspend_default_s2idle()alone. No failure was seen from them here: the PHY's keeps the always-on domain for the transition, which an s2idle keeps anyway.