]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd: Pass IP suspend errors up to callers
authorMario Limonciello <mario.limonciello@amd.com>
Thu, 2 Oct 2025 17:42:43 +0000 (12:42 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 13 Oct 2025 18:14:34 +0000 (14:14 -0400)
If IP suspend fails the callers should be notified so that they can
potentially react.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index 70f5ff4c63e741fdb53574ee85a7a86dfe23a968..a734c05cc00e4971e7918bfb0ab691a99773f21e 100644 (file)
@@ -3862,8 +3862,9 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev)
                    adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_PSP)
                        continue;
 
-               /* XXX handle errors */
                r = amdgpu_ip_block_suspend(&adev->ip_blocks[i]);
+               if (r)
+                       return r;
 
                /* handle putting the SMC in the appropriate state */
                if (!amdgpu_sriov_vf(adev)) {
@@ -5218,7 +5219,9 @@ int amdgpu_device_suspend(struct drm_device *dev, bool notify_clients)
 
        amdgpu_ras_suspend(adev);
 
-       amdgpu_device_ip_suspend_phase1(adev);
+       r = amdgpu_device_ip_suspend_phase1(adev);
+       if (r)
+               return r;
 
        amdgpu_amdkfd_suspend(adev, !amdgpu_sriov_vf(adev) && !adev->in_runpm);
        amdgpu_userq_suspend(adev);
@@ -5231,7 +5234,9 @@ int amdgpu_device_suspend(struct drm_device *dev, bool notify_clients)
 
        amdgpu_fence_driver_hw_fini(adev);
 
-       amdgpu_device_ip_suspend_phase2(adev);
+       r = amdgpu_device_ip_suspend_phase2(adev);
+       if (r)
+               return r;
 
        if (amdgpu_sriov_vf(adev))
                amdgpu_virt_release_full_gpu(adev, false);