From: Michel Dänzer Date: Mon, 25 Jun 2018 09:07:17 +0000 (+0200) Subject: drm/amdgpu: Reserve VM root shared fence slot for command submission (v3) X-Git-Tag: v4.19~598^2~6^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ed6b4b5559769c6c5a0fcb3fac8a9e1f4e58c4ae;p=platform%2Fkernel%2Flinux-rpi.git drm/amdgpu: Reserve VM root shared fence slot for command submission (v3) 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 Signed-off-by: Junwei Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 82312a7..9c85a90 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -927,6 +927,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);