From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com ([74.125.82.67]:37885 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932652AbeGDGer (ORCPT ); Wed, 4 Jul 2018 02:34:47 -0400 Received: by mail-wm0-f67.google.com with SMTP id n17-v6so4450791wmh.2 for ; Tue, 03 Jul 2018 23:34:47 -0700 (PDT) Reply-To: christian.koenig@amd.com Subject: Re: [PATCH] drm/amdgpu: Reserve fence slots for command submission To: Junwei Zhang , amd-gfx@lists.freedesktop.org Cc: michel.daenzer@amd.com, christian.koenig@amd.com, stable@vger.kernel.org References: <1530673358-20219-1-git-send-email-Jerry.Zhang@amd.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: Date: Wed, 4 Jul 2018 08:34:44 +0200 MIME-Version: 1.0 In-Reply-To: <1530673358-20219-1-git-send-email-Jerry.Zhang@amd.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: stable-owner@vger.kernel.org List-ID: Am 04.07.2018 um 05:02 schrieb Junwei Zhang: > From: Michel Dänzer > > 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 I would put that at the end of amdgpu_bo_vm_update_pte(), but that is only a minor nit pick. Patch is Reviewed-by: Christian König anyway. Regards, Christian. > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c > index 7a625f3..1bc0281 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c > @@ -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);