[PATCH 1/2] drm/amdgpu: alway cancel uvd idle work

Christian König ckoenig.leichtzumerken at gmail.com
Thu Dec 14 12:02:22 UTC 2017


Am 14.12.2017 um 12:38 schrieb Jim Qu:
> Change-Id: I06e5460ece91e812cda28fb02a6b78676d921e18
> Signed-off-by: Jim Qu <Jim.Qu at amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> index 916e516..343b682 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> @@ -294,6 +294,8 @@ int amdgpu_uvd_suspend(struct amdgpu_device *adev)
>   	void *ptr;
>   	int i;
>   
> +	cancel_delayed_work_sync(&adev->uvd.idle_work);
> +
>   	if (adev->uvd.vcpu_bo == NULL)
>   		return 0;

Good catch, but you moved it a bit to hight I think. When 
adev->uvd.vcpu_bo is NULL the delayed work item might never have been 
initialized.

Not sure if that is a problem, but I would just move the 
cancel_delayed_work after the "if" just to be on the safe side.

Christian.

>   
> @@ -304,8 +306,6 @@ int amdgpu_uvd_suspend(struct amdgpu_device *adev)
>   	if (i == AMDGPU_MAX_UVD_HANDLES)
>   		return 0;
>   
> -	cancel_delayed_work_sync(&adev->uvd.idle_work);
> -
>   	size = amdgpu_bo_size(adev->uvd.vcpu_bo);
>   	ptr = adev->uvd.cpu_addr;
>   



More information about the amd-gfx mailing list