* [PATCH] drm/amdgpu: Reserve fence slots for command submission
@ 2018-07-04 3:02 Junwei Zhang
2018-07-04 6:34 ` Christian König
0 siblings, 1 reply; 3+ messages in thread
From: Junwei Zhang @ 2018-07-04 3:02 UTC (permalink / raw)
To: amd-gfx; +Cc: michel.daenzer, christian.koenig, stable, Junwei Zhang
From: Michel Dänzer <michel.daenzer@amd.com>
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>
---
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);
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amdgpu: Reserve fence slots for command submission
2018-07-04 3:02 [PATCH] drm/amdgpu: Reserve fence slots for command submission Junwei Zhang
@ 2018-07-04 6:34 ` Christian König
2018-07-04 6:55 ` Zhang, Jerry (Junwei)
0 siblings, 1 reply; 3+ messages in thread
From: Christian König @ 2018-07-04 6:34 UTC (permalink / raw)
To: Junwei Zhang, amd-gfx; +Cc: michel.daenzer, christian.koenig, stable
Am 04.07.2018 um 05:02 schrieb Junwei Zhang:
> From: Michel Dänzer <michel.daenzer@amd.com>
>
> 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>
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 <christian.koenig@amd.com> 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);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amdgpu: Reserve fence slots for command submission
2018-07-04 6:34 ` Christian König
@ 2018-07-04 6:55 ` Zhang, Jerry (Junwei)
0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Jerry (Junwei) @ 2018-07-04 6:55 UTC (permalink / raw)
To: christian.koenig, amd-gfx; +Cc: michel.daenzer, stable
On 07/04/2018 02:34 PM, Christian König wrote:
> Am 04.07.2018 um 05:02 schrieb Junwei Zhang:
>> From: Michel Dänzer <michel.daenzer@amd.com>
>>
>> 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>
>
> I would put that at the end of amdgpu_bo_vm_update_pte(), but that is only a minor nit pick.
At first, I really put it at the end of amdgpu_bo_vm_update_pte().
On the 2nd thought, that func may be called by others(although it's not for now),
so I move it out of there to the caller.
Jerry
>
> Patch is Reviewed-by: Christian König <christian.koenig@amd.com> 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);
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-04 6:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-04 3:02 [PATCH] drm/amdgpu: Reserve fence slots for command submission Junwei Zhang
2018-07-04 6:34 ` Christian König
2018-07-04 6:55 ` Zhang, Jerry (Junwei)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).