[PATCH 1/1] drm/amdgpu: vm flush needed after updating PDEs

Christian König christian.koenig at amd.com
Tue May 10 15:07:31 UTC 2022


Am 10.05.22 um 16:36 schrieb Philip Yang:
> If page table PDEs is evicted and restored, after updating PDEs, need
> increase vm->tlb_seq, then amdgpu_vm_flush will flush TLB before command
> submission.
>
> Signed-off-by: Philip Yang <Philip.Yang at amd.com>

Reviewed-by: Christian König <christian.koenig at amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 7276b03ef970..9596c22fded6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -764,6 +764,9 @@ int amdgpu_vm_update_pdes(struct amdgpu_device *adev,
>   	if (r)
>   		goto error;
>   
> +	/* vm_flush_needed after updating PDEs */
> +	atomic64_inc(&vm->tlb_seq);
> +
>   	while (!list_empty(&vm->relocated)) {
>   		entry = list_first_entry(&vm->relocated,
>   					 struct amdgpu_vm_bo_base,



More information about the amd-gfx mailing list