Skip to content

drm/amd/pm: defer UCLK DPM enablement on Apple Navi 14 0218 - #60

Open
edschofield wants to merge 2 commits into
t2linux:mainfrom
edschofield:fix/apple-0218-late-uclk
Open

drm/amd/pm: defer UCLK DPM enablement on Apple Navi 14 0218#60
edschofield wants to merge 2 commits into
t2linux:mainfrom
edschofield:fix/apple-0218-late-uclk

Conversation

@edschofield

@edschofield edschofield commented Sep 8, 2026

Copy link
Copy Markdown

On an iMac20,1 (2020, 27") with GPU 1002:7340 / 106b:0218, revision 41, the normal EnableAllSmuFeatures request can time out with error -62, leaving no AMDGPU DRM device. This patch leaves UCLK DPM out of that request and enables it from Navi's post-init callback. It then verifies the firmware bit and refreshes the driver's supported-feature bit, memory DPM table and sustainable clock limits.

Both memory-voltage features stay enabled during normal initialization. The patch respects PP_MCLK_DPM_MASK, validates the PPT memory states consumed by DCN20, and matches only the tested 0218/41 board. It leaves patch 6001's 0219 workaround unchanged.

This follows Atharva Tiwari's delayed-UCLK proposal for 0219. I described results with my hardware in
the September 4 comment on kernel issue 19. Enabling UCLK separately immediately after enable-all failed in an earlier
experiment; the later callback is the tested point in initialization. The results do not establish the firmware's internal cause.

Here's the testing I've done on my iMac:

Implementation Evidence
Experimental test3 40 successful warm boots and 10 cold boots: eight with AC connected, two with the iMac unplugged after orderly shutdown
Same-kernel control Restoring the original policy reproduced the enable-all timeout; delayed-UCLK warm recovery passed
This production patch on T2 7.2.3 Normal warm boot, hardware rendering, VAAPI H.264 comparison, and sustained rendering with all four memory states observed
Production cold conditions Prescribed AC-connected and AC-unplugged starts passed, with operator-confirmed 60-second intervals and rendering/video checks; an additional AC-connected power-on also passed and is recorded separately
Production public-policy exclusion Separate warm boot with MCLK DPM disabled; expected fixed state, rendering and VAAPI pass
Production memory/update checks Ten-minute Vulkan memory test with 2 GiB budget and load/idle/load transition; normal boot/render/video pass after a full system update and initramfs regeneration
Build and host checks Full T2 build, module inventory/depmod checks, and 49,177 extracted-C cases with ASan/UBSan and mocked firmware

The build uses Arch v7.2.3-arch1 plus T2 patch collection 1ed4126844013f7e6fb3c8b0347cf0c5d6f99ffa. Historical counts belong to the experimental implementation. An intended unplugged start was corrected to AC-connected when the operator clarified the sequence; the actual unplugged check was then performed and confirmed. Other Apple boards, macOS-predecessor starts, suspend/resume and native 5K have not been validated. Boot-time MCE and Bluetooth observations remain outside this GPU initialization patch.

I would appreciate review of the callback ordering and clock-state updates, and testing on other affected hardware before considering a broader match. The intended destination is AMDGPU upstream; carrying it in T2 would also make the tested fix available to affected users.

This work was prompted by frequent, intermittent boot failures on my iMac due to the GPU not being initialized. I used Codex / GPT-6 to do the source investigation, patch implementation, test scripts, as well as then by requests to isolate the UCLK sequencing change, retain public policy behaviour and validate a production extraction. The checks above include compiled C, real hardware and an original-policy control; the host tests use mocked firmware.

Formatting checks: checkpatch --strict --no-signoff reports zero errors, two warnings and five checks. The warnings concern the accessible mail-archive link and the older assistance-trailer format expected by the checked-out checker; the five checks concern existing firmware-interface CamelCase names.

Add the board-specific initialization workaround for the tested 0218/41
iMac. Keep the existing 0219 patch unchanged.

Assisted-by: LLM
Defer UCLK DPM enablement to avoid timeouts on Apple iMac 1002:7340/106b:0218. Update firmware bit and memory DPM table accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant