Skip to contentSkip to conversation

Address amdgpu reload issues in APUs

PATCH Applied Rodrigo Siqueira 4 participants 6 messages Nov 21, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v5 cover Address amdgpu reload issues in APUs

This series addresses the issue of amdgpu reload failures in APUs. The first commit adds a GPU reset during unload time, and the second commit removes a specific fix for the Renoir device that becomes outdated with the first patch.

Changes since V4:
- Add a code comment about PSP behavior.

Thanks
Siqueira

Rodrigo Siqueira (2):
drm/amdgpu: Fix GFX hang on SteamDeck when amdgpu is reloaded Revert "drm/amd: fix gfx hang on renoir in IGT reload test"

 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 14 ++++++++++++++
 drivers/gpu/drm/amd/amdgpu/soc15.c         |  4 ----
 2 files changed, 14 insertions(+), 4 deletions(-)
Signature · 1 line
2.51.0
#1 lore raw

PATCH v5 1/2 drm/amdgpu: Fix GFX hang on SteamDeck when amdgpu is reloaded

When trying to unload amdgpu in the SteamDeck (TTY mode), the following set of errors happens and the system gets unstable:

[..]
[drm] Initialized amdgpu 3.64.0 for 0000:04:00.0 on minor 0
amdgpu 0000:04:00.0: [drm:amdgpu_ib_ring_tests [amdgpu]] *ERROR* IB test failed on gfx_0.0.0 (-110). amdgpu 0000:04:00.0: amdgpu: ib ring test failed (-110).
[..]
amdgpu 0000:04:00.0: amdgpu: SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x0000001E SMN_C2PMSG_82:0x00000000 amdgpu 0000:04:00.0: amdgpu: Failed to disable gfxoff!
amdgpu 0000:04:00.0: amdgpu: SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x0000001E SMN_C2PMSG_82:0x00000000 amdgpu 0000:04:00.0: amdgpu: Failed to disable gfxoff!
[..]

When the driver initializes the GPU, the PSP validates all the firmware loaded, and after that, it is not possible to load any other firmware unless the device is reset. What is happening in the load/unload situation is that PSP halts the GC engine because it suspects that something is amiss. To address this issue, this commit ensures that the GPU is reset (mode 2 reset) in the unload sequence.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +14 -0
index 54f7c81f287b..10c9e0044ade 100644
@@ -3682,6 +3682,20 @@ static int amdgpu_device_ip_fini_early(struct amdgpu_device *adev)
 				"failed to release exclusive mode on fini\n");
 	}
 
+	/*
+	 * Driver reload on the APU can fail due to firmware validation because
+	 * the PSP is always running, as it is shared across the whole SoC.
+	 * This same issue does not occur on dGPU because it has a mechanism
+	 * that checks whether the PSP is running. A solution for those issues
+	 * in the APU is to trigger a GPU reset, but this should be done during
+	 * the unload phase to avoid adding boot latency and screen flicker.
+	 */
+	if ((adev->flags & AMD_IS_APU) && !adev->gmc.is_app_apu) {
+		r = amdgpu_asic_reset(adev);
+		if (r)
+			dev_err(adev->dev, "asic reset on %s failed\n", __func__);
+	}
+
 	return 0;
 }
 
Signature · 1 line
2.51.0
#2 lore raw

PATCH v5 2/2 Revert "drm/amd: fix gfx hang on renoir in IGT reload test"

In reply to Rodrigo Siqueira

The original patch introduced additional latency during boot time because it triggers a driver reload to avoid a CP hang when the driver is reloaded multiple times. This has been addressed with a more generic solution that triggers the GPU reset only during the unload phase, avoiding extra latency during boot time. For this reason, this commit reverts the original change.

This reverts commit 72a98763b473890e6605604bfcaf71fc212b4720.

---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +0 -4
index 9785fada4fa7..42f5d9c0e3af 100644
@@ -853,10 +853,6 @@ static bool soc15_need_reset_on_init(struct amdgpu_device *adev)
 {
 	u32 sol_reg;
 
-	/* CP hangs in IGT reloading test on RN, reset to WA */
-	if (adev->asic_type == CHIP_RENOIR)
-		return true;
-
 	if (amdgpu_gmc_need_reset_on_init(adev))
 		return true;
 	if (amdgpu_psp_tos_reload_needed(adev))
Signature · 1 line
2.51.0
Applied
#3 lore raw

Re: [PATCH v5 2/2] Revert "drm/amd: fix gfx hang on renoir in IGT reload test"

Applied the series. Thanks!

Alex

Quoted 33 lines · Rodrigo Siqueira

The original patch introduced additional latency during boot time because it triggers a driver reload to avoid a CP hang when the driver is reloaded multiple times. This has been addressed with a more generic solution that triggers the GPU reset only during the unload phase, avoiding extra latency during boot time. For this reason, this commit reverts the original change.

This reverts commit 72a98763b473890e6605604bfcaf71fc212b4720.

---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +0 -5
index 9785fada4fa7..42f5d9c0e3af 100644
@@ -853,10 +853,6 @@ static bool soc15_need_reset_on_init(struct amdgpu_device *adev)
 {
        u32 sol_reg;
 
-       /* CP hangs in IGT reloading test on RN, reset to WA */
-       if (adev->asic_type == CHIP_RENOIR)
-               return true;
-
        if (amdgpu_gmc_need_reset_on_init(adev))
                return true;
        if (amdgpu_psp_tos_reload_needed(adev))
--

2.51.0

Reviewed-by on the v5 series
#4 lore raw
In reply to Rodrigo Siqueira
Quoted 11 lines · Rodrigo Siqueira

This series addresses the issue of amdgpu reload failures in APUs. The first commit adds a GPU reset during unload time, and the second commit removes a specific fix for the Renoir device that becomes outdated with the first patch.

Changes since V4:
- Add a code comment about PSP behavior.

Thanks
Siqueira

Quoted 8 lines

Rodrigo Siqueira (2):
drm/amdgpu: Fix GFX hang on SteamDeck when amdgpu is reloaded Revert "drm/amd: fix gfx hang on renoir in IGT reload test"

  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 14 ++++++++++++++
  drivers/gpu/drm/amd/amdgpu/soc15.c         |  4 ----
  2 files changed, 14 insertions(+), 4 deletions(-)

Series looks good to me.

maintainer Acked-by on the v5 series
#5 lore raw
In reply to Rodrigo Siqueira
Quoted 7 lines · Rodrigo Siqueira

This series addresses the issue of amdgpu reload failures in APUs. The first commit adds a GPU reset during unload time, and the second commit removes a specific fix for the Renoir device that becomes outdated with the first patch.

Changes since V4:
- Add a code comment about PSP behavior.

Quoted 12 lines

Thanks
Siqueira

Rodrigo Siqueira (2):
drm/amdgpu: Fix GFX hang on SteamDeck when amdgpu is reloaded Revert "drm/amd: fix gfx hang on renoir in IGT reload test"

 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 14 ++++++++++++++
 drivers/gpu/drm/amd/amdgpu/soc15.c         |  4 ----
 2 files changed, 14 insertions(+), 4 deletions(-)