On 2022-03-28 5:21 a.m., Christian König wrote:
Am 26.03.22 um 01:56 schrieb Philip Yang:
MMU callback update page table set unlocked flag, add callback tlb_cb to
vm->last_unlocked fence, and pass it back to upper layer to wait for
page table update done.

Signed-off-by: Philip Yang <philip.y...@amd.com>
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 48f326609976..aac1b625194f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -927,7 +927,10 @@ int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
        r = vm->update_funcs->commit(&params, fence);
  -    if (!unlocked && (!(flags & AMDGPU_PTE_VALID) || params.table_freed)) {
+    if (!(flags & AMDGPU_PTE_VALID) || params.table_freed) {

Dropping the check for the unlocked flag here seems to be ok.

+        if (unlocked && fence)
+            *fence = dma_fence_get(vm->last_unlocked);
+

But that doesn't seems to make sense, fence should already contain the necessary fence object if any.

You are right, seems there is another bug, will send out v2 patch to fix the bug and remove this.

Regards,

Philip


Regards,
Christian.


          tlb_cb->vm = vm;
          if (!fence || !*fence ||
              dma_fence_add_callback(*fence, &tlb_cb->cb,

Reply via email to