]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amd/display: Catch errors from drm_atomic_helper_suspend()
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 6 Oct 2023 18:50:24 +0000 (13:50 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 13 Oct 2023 15:01:16 +0000 (11:01 -0400)
drm_atomic_helper_suspend() can return PTR_ERR(), in which case the
error gets stored into `dm->cached_state`.  This can cause failures
during resume.  Catch the error during suspend and fail the suspend
instead.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2362
Acked-by: Christian König <christian.koenig@amd.com>
Acked-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/display/amdgpu_dm/amdgpu_dm.c

index c9a272d960a12698d94111fd3192f0ced6d7e68b..37d8c46ddfead1da4d9c32311bd5afa2544cb7a0 100644 (file)
@@ -2698,6 +2698,8 @@ static int dm_suspend(void *handle)
 
        WARN_ON(adev->dm.cached_state);
        adev->dm.cached_state = drm_atomic_helper_suspend(adev_to_drm(adev));
+       if (IS_ERR(adev->dm.cached_state))
+               return PTR_ERR(adev->dm.cached_state);
 
        s3_handle_mst(adev_to_drm(adev), true);