drm/amdgpu: Reserve VM root shared fence slot for command submission (v3)
authorMichel Dänzer <michel.daenzer@amd.com>
Mon, 25 Jun 2018 09:07:17 +0000 (11:07 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 10 Jul 2018 19:16:21 +0000 (14:16 -0500)
Without this, there could not be enough slots, which could trigger the
BUG_ON in reservation_object_add_shared_fence.

v2:
* Jump to the error label instead of returning directly (Jerry Zhang)
v3:
* Reserve slots for command submission after VM updates (Christian König)

Cc: stable@vger.kernel.org
Bugzilla: https://bugs.freedesktop.org/106418
Reported-by: mikhail.v.gavrilov@gmail.com
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Junwei Zhang <Jerry.Zhang@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_cs.c

index 7a625f3989a00166c5d12a3db1ce41e0887934ee..1bc02816989d74b400d4094da0e30cc6a5dd485b 100644 (file)
@@ -928,6 +928,10 @@ static int amdgpu_cs_ib_vm_chunk(struct amdgpu_device *adev,
                r = amdgpu_bo_vm_update_pte(p);
                if (r)
                        return r;
+
+               r = reservation_object_reserve_shared(vm->root.base.bo->tbo.resv);
+               if (r)
+                       return r;
        }
 
        return amdgpu_cs_sync_rings(p);