<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 2022-03-28 5:21 a.m., Christian
      König wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:af7b9210-01e6-261e-b7c2-de29275f7a0b@amd.com">Am
      26.03.22 um 01:56 schrieb Philip Yang:
      <br>
      <blockquote type="cite">MMU callback update page table set
        unlocked flag, add callback tlb_cb to
        <br>
        vm->last_unlocked fence, and pass it back to upper layer to
        wait for
        <br>
        page table update done.
        <br>
        <br>
        Signed-off-by: Philip Yang <a class="moz-txt-link-rfc2396E" href="mailto:Philip.Yang@amd.com"><Philip.Yang@amd.com></a>
        <br>
        ---
        <br>
          drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 ++++-
        <br>
          1 file changed, 4 insertions(+), 1 deletion(-)
        <br>
        <br>
        diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
        b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
        <br>
        index 48f326609976..aac1b625194f 100644
        <br>
        --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
        <br>
        +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
        <br>
        @@ -927,7 +927,10 @@ int amdgpu_vm_bo_update_mapping(struct
        amdgpu_device *adev,
        <br>
                r = vm->update_funcs->commit(&params, fence);
        <br>
          -    if (!unlocked && (!(flags & AMDGPU_PTE_VALID)
        || params.table_freed)) {
        <br>
        +    if (!(flags & AMDGPU_PTE_VALID) || params.table_freed)
        {
        <br>
      </blockquote>
      <br>
      Dropping the check for the unlocked flag here seems to be ok.
      <br>
      <br>
      <blockquote type="cite">+        if (unlocked && fence)
        <br>
        +            *fence = dma_fence_get(vm->last_unlocked);
        <br>
        +
        <br>
      </blockquote>
      <br>
      But that doesn't seems to make sense, fence should already contain
      the necessary fence object if any.
      <br>
    </blockquote>
    <p>You are right, seems there is another bug, will send out v2 patch
      to fix the bug and remove this.</p>
    <p>Regards,</p>
    <p>Philip<br>
    </p>
    <blockquote type="cite" cite="mid:af7b9210-01e6-261e-b7c2-de29275f7a0b@amd.com">
      <br>
      Regards,
      <br>
      Christian.
      <br>
      <br>
      <br>
      <blockquote type="cite">          tlb_cb->vm = vm;
        <br>
                  if (!fence || !*fence ||
        <br>
                      dma_fence_add_callback(*fence, &tlb_cb->cb,
        <br>
      </blockquote>
      <br>
    </blockquote>
  </body>
</html>