drm/amdgpu: always cancel uvd idle handler in uvd suspend
authorJim Qu <Jim.Qu@amd.com>
Fri, 15 Dec 2017 07:27:57 +0000 (15:27 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 18 Dec 2017 16:51:59 +0000 (11:51 -0500)
Signed-off-by: Jim Qu <Jim.Qu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c

index bd6d3a1..2b47c0d 100644 (file)
@@ -297,6 +297,8 @@ int amdgpu_uvd_suspend(struct amdgpu_device *adev)
        if (adev->uvd.vcpu_bo == NULL)
                return 0;
 
+       cancel_delayed_work_sync(&adev->uvd.idle_work);
+
        for (i = 0; i < adev->uvd.max_handles; ++i)
                if (atomic_read(&adev->uvd.handles[i]))
                        break;
@@ -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;