Repository navigation
drm/asahi: g16: Write all four 26B123 power-up words, so the GPU survives a deep wake - #2742
Conversation
…ives a deep wake The 26B123 POWER_PERFORMANCE layout inserts four u32s at +0x9c. G16 writes only +0xa4, the powered-up state selector. That is enough for a cold boot, but not for the firmware's warm restart after a deep sleep: on the J713 (M4 Air) the first deep wake ends with "GPU firmware back in 691 us" and, 0.3 ms later, "RTKit: co-processor has crashed" in the firmware's power-up path, before any client has submitted work. The GPU is gone until reboot. macOS 27.2 sets all four words to 1, and so did this driver before the 26B123 layout was reworked. Write +0x9c, +0xa0 and +0xa8 again, next to +0xa4. The words belong to the 26B123 layout, so they are selected by the firmware ABI, as before; 25G83 is unchanged. On the J713 (macOS 27.2 firmware, default kernel command line) with the external monitor and the USB4 peer attached: 3 of 3 deep sleeps wake with the GPU alive, with vkmark running across the first sleep, then dEQP-VK smoke and glmark2 after the wakes. Without the change the same kernel crashed on the first wake. The host tests and the 26B123 offset oracle are updated for the three words. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Adversarial review of 4085b87 (I ran the t5p split kernel this PR is based on). Verdict: no blockers. Two should-fixes, both in the PR text, and one row to add. Checked, OK
Should-fix (PR text)
Add to Still to run
Evidence: traces/gpu/20261122-j713-deep2/deepwake-t5p (s2gpu.txt line 21 for the |
|
Adversarial review at 4085b87: no blockers. One should-fix (documentation), and the gate row is still owed. What I tried:
Should-fix (non-blocking): the code names only Rows: the J713 promotion gate (10 deep sleeps of 20 s with the monitor and USB4 peer, a GPU job after each wake, s2idle 3x, warm 3x) runs on the next J713 default candidate, which carries this PR plus integration tip. I'll post the result here. |
|
Promotion gate row on the J713 is done: PASS, and this commit is now in the J713 default. Kernel
From our side this is ready to merge into |
Problem
On the M4 Air (J713) with the macOS 27.2 GPU firmware (26B123), the GPU does not survive a deep sleep. On the first wake the firmware comes back (
GPU firmware back in 691 us), and 0.3 ms laterRTKit: co-processor has crashedin its power-up path, before any client has submitted work. The GPU is gone until reboot. Deep sleep itself now works on the J713 (#2692, #2721), so this is the last thing stopping it on the default.Change
The 26B123 POWER_PERFORMANCE layout inserts four u32s at +0x9c. G16 writes only +0xa4 (the powered-up state selector). This writes +0x9c, +0xa0 and +0xa8 = 1 as well, as this driver did before the 26B123 layout was reworked (923d1ec). They are power-state enables (1), not limits or tuning values. The code comment says they are written as a group because the warm restart needs all four. The words belong to the 26B123 layout, which the firmware ABI selects; 25G83 is unchanged. No gates, no parameters.
Stacked on #2676 (
djdev/g16-272at ed41e08), so it can be folded into it.Testing
J713, default kernel command line, external MSI monitor on USB-C and the USB4 peer attached,
rtcwake -m memon the PMU RTC:make cpu) passes, including the 26B123 offset oracle, which now expects the three words.Still to run
Logs and kernels
GPU stop at the commit: idle 0 0, PMP request 0, domain 0xf002800 (-110)->GPU firmware back in 691 us->RTKit: co-processor has crashed, the known 26B123 power-up crash PC. After the first wake every later wake prints onlyback in 43 usand the device is wedged.-110commit warning and no crash, but those rows ran no GPU work after the wakes.-110commit warning is not fixed by this change: on t5p the first sleep, taken with vkmark running, still loggedGPU stop at the commit ... (-110), then the firmware was back in 639 us with no crash (wakes 2 and 3 did not log it). What this fixes is the crash after the warm restart; the clean stop at the commit is a separate open item.7.3.0-bj713t5w+(t5 + the four POWER_PERFORMANCE words + the four GLOBALS words) and7.3.0-bj713t5p+(t5 + only these three POWER_PERFORMANCE words, i.e. this PR's change). Both passed 3/3. The A/B traces are in the lab store (traces/gpu/20261122-j713-gpu-1000/deepwake-ab, traces/gpu/20261122-j713-deep2).scheduler 0with and without the change (the older head reported 1), so that value is not tied to these words.Assisted-by: LLM (Claude:Opus 5.5)