]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/amd/display: Catch failures for amdgpu_dm_commit_zero_streams()
authorMario Limonciello <mario.limonciello@amd.com>
Tue, 18 Feb 2025 04:58:30 +0000 (22:58 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 5 Mar 2025 15:41:21 +0000 (10:41 -0500)
amdgpu_dm_commit_zero_streams() returns a DC error code that isn't
checked. Add an explicit check to this and fail dm_suspend() if it
is not DC_OK.

Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index c0887693f7d00a5dab7393e6e7b2f453d574cd4f..80503d084b828fe8c274672bac1d9f4771831b28 100644 (file)
@@ -3147,6 +3147,8 @@ static int dm_suspend(struct amdgpu_ip_block *ip_block)
        struct amdgpu_display_manager *dm = &adev->dm;
 
        if (amdgpu_in_reset(adev)) {
+               enum dc_status res;
+
                mutex_lock(&dm->dc_lock);
 
                dc_allow_idle_optimizations(adev->dm.dc, false);
@@ -3156,7 +3158,11 @@ static int dm_suspend(struct amdgpu_ip_block *ip_block)
                if (dm->cached_dc_state)
                        dm_gpureset_toggle_interrupts(adev, dm->cached_dc_state, false);
 
-               amdgpu_dm_commit_zero_streams(dm->dc);
+               res = amdgpu_dm_commit_zero_streams(dm->dc);
+               if (res != DC_OK) {
+                       drm_err(adev_to_drm(adev), "Failed to commit zero streams: %d\n", res);
+                       return -EINVAL;
+               }
 
                amdgpu_dm_irq_suspend(adev);