[PATCH v5 5/7] drm/amd/display: Catch errors from drm_atomic_helper_suspend()

Christian König ckoenig.leichtzumerken at gmail.com
Mon Oct 9 09:06:44 UTC 2023


Am 06.10.23 um 20:50 schrieb Mario Limonciello:
> 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
> Signed-off-by: Mario Limonciello <mario.limonciello at amd.com>

Acked-by: Christian König <christian.koenig at amd.com>

> ---
> v4->v5:
>   * New patch
> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index a59a11ae42db..63944d3b9e8c 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -2716,6 +2716,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);
>   



More information about the amd-gfx mailing list