drm/amdgpu: fix userptr lockup
authorChristian König <christian.koenig@amd.com>
Mon, 4 May 2015 11:20:36 +0000 (13:20 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 4 Jun 2015 01:03:26 +0000 (21:03 -0400)
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c

index b3a17a9ab1f4ab0881be47e9cba85168612c6054..b1969f2b2038db79af8447fc9826ba8257207cf4 100644 (file)
@@ -142,6 +142,9 @@ static void amdgpu_mn_invalidate_range_start(struct mmu_notifier *mn,
 
                list_for_each_entry(bo, &node->bos, mn_list) {
 
+                       if (!bo->tbo.ttm || bo->tbo.ttm->state != tt_bound)
+                               continue;
+
                        r = amdgpu_bo_reserve(bo, true);
                        if (r) {
                                DRM_ERROR("(%ld) failed to reserve user bo\n", r);