CachyOS / CachyOS/kernel-patches

Vega10/gfx900 (Instinct MI25): PSP handshake timeout - 3-line mdelay fix, card dead on stock 7.2.x

Open
#183 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
371
Forks
80
PR merge metrics
No merged PRs in 30d

Description

# Title: linux-cachyos: Vega10/gfx900 (Instinct MI25) PSP handshake timeout — 3-line fix, card unusable on stock kernel

## Summary
Instinct MI25 (Vega10/gfx900) fails amdgpu init on linux-cachyos 7.2.x (and other current kernels):
PSP times out loading its secure OS, init aborts with -22, and the card is dead. A 3-line patch
(`mdelay(20)` -> `mdelay(500)` in psp_v3_1.c) fixes it completely. Verified on 7.2.4.

## Symptom (stock kernel)
```
amdgpu 0000:06:00.0: [drm] PSP loading UVD firmware
amdgpu 0000:06:00.0: psp reg (0x16080) wait timed out, mask: 8000ffff, read: 80080124 exp: 80000000
amdgpu 0000:06:00.0: PSP load sos failed!
amdgpu 0000:06:00.0: hw_init of IP block failed -22
amdgpu 0000:06:00.0: Fatal error during GPU init
amdgpu 0000:06:00.0: probe with driver amdgpu failed with error -22
```
(Failure path also NULL-derefs in drm_sched_entity_fini during teardown on some runs.)

## Root cause
psp_v3_1.c waits only 20 ms after writing PSP_BL__LOAD_SYSDRV / LOAD_SOSDRV before polling the
C2PMSG handshake. On this card (and other Vega10s, per community reports since 2022) the PSP
firmware needs longer to respond; the poll then times out and init aborts. Same failure and fix
documented 4 years ago: https://superuser.com/questions/1747738 (kernel patch mdelay 20->500ms).

## Fix (verified)
```
drivers/gpu/drm/amd/amdgpu/psp_v3_1.c: 3 hunks, mdelay(20) -> mdelay(500)
psp_v3_1_bootloader_load_sysdrv (C2PMSG_35 handshake)
psp_v3_1_bootloader_load_sos (C2PMSG_81 sign-of-life)
one more handshake site at ~line 266
```
One-time 500 ms boot delays; no hot-path cost. Patch file: https://gist.github.com/jamesonBradfield/70269fa7c4c40641699d22aaa041c854 (0001-amdgpu-psp-v3-1-handshake-delay.patch, 3 hunks, a/b format)

## Verification
- linux-cachyos 7.2.4-2 built with the patch (AUR PKGBUILD + patch): MI25 initializes cleanly
("Initialized amdgpu 3.64.0 for 0000:06:00.0"), 16GB VRAM live, full day of dual-GPU
llama.cpp Vulkan benchmarking stable, temps/fan normal.
- Reproduced the failure on both 7.2.2 stock and 6.18.48-lts stock; fixed on 7.2.4-2 patched.

## Ask
Carry this 3-line quirk patch in the cachyos kernel patchset (kernel-patches misc/), or accept an
upstream submission. gfx900 is EOL upstream so mainline likely won't take it — CachyOS carrying it
is the practical path for MI25/Vega10 users on rolling kernels. Happy to open a PR against
CachyOS/kernel-patches with the patch + this report.

## Related (separate)
Also required for this card: kernel param `pci=realloc` for the 16GB BAR ("can't assign; no
space" on the card's PCIe-switch subtree) — BIOS/firmware interaction, likely not kernel-package
territory; noting for completeness.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with drivers/gpu/drm/amd/amdgpu/psp_v3_1.c and inspect the three handshake sites named in the issue. Apply the supplied patch through the CachyOS kernel-patches workflow, build a kernel, and verify that the MI25 initializes without the PSP timeout and reports its VRAM successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.