Skip to contentSkip to conversation

drm/amd: Reset ASIC on GPU resume failure

RFC New Mario Limonciello 1 participant 1 message May 19, 2022

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

RFC 1/1 drm/amd: Reset ASIC on GPU resume failure

Is the resume failed, it's unlikely that the GPU will be usable. Reset the ASIC in hopes that it will be able to recover from the problem.

---
This is RFC as it's conceptual, and we should wait for testing that it actually works.

 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +7 -0
index 3b9dc1803be9..4c2a0aea5a6b 100644
@@ -2333,6 +2333,13 @@ static int amdgpu_pmops_resume(struct device *dev)
 		adev->no_hw_access = true;
 
 	r = amdgpu_device_resume(drm_dev, true);
+	if (r) {
+		dev_err(adev->dev, "resume failed with %d; attempting to reset ASIC\n", r);
+		r = amdgpu_asic_reset(adev);
+		if (!r)
+			r = amdgpu_device_resume(drm_dev, true);
+	}
+
 	if (amdgpu_acpi_is_s0ix_active(adev))
 		adev->in_s0ix = false;
 	else
Signature · 1 line
2.34.1