<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Am 05.03.19 um 03:37 schrieb 周磊:<br>
    </div>
    <blockquote type="cite"
cite="mid:CALKDN1PRNNDMhNKYaNsFdkYCKM4R4tUtQ9svXdmPwBQL6=AzFA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">I got this kernel Oops when running ROCm kernel in
        a ARM64 machine with Vega64 card.
        <div><br>
          <div>
            <pre style="color:rgb(0,0,0);white-space:pre-wrap">---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
index 20d7e4775d49..b6945af39b95 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
@@ -726,8 +726,8 @@ static bool gmc_v9_0_keep_stolen_memory(struct amdgpu_device *adev)
 static int gmc_v9_0_allocate_vm_inv_eng(struct amdgpu_device *adev)
 {
        struct amdgpu_ring *ring;
-       unsigned vm_inv_engs[AMDGPU_MAX_VMHUBS] =
-               {GFXHUB_FREE_VM_INV_ENGS_BITMAP, MMHUB_FREE_VM_INV_ENGS_BITMAP};
+       unsigned long vm_inv_engs[AMDGPU_MAX_VMHUBS] =
+                     {GFXHUB_FREE_VM_INV_ENGS_BITMAP, MMHUB_FREE_VM_INV_ENGS_BITMAP};
        unsigned i;
        unsigned vmhub, inv_eng;
 
@@ -743,7 +743,7 @@ static int gmc_v9_0_allocate_vm_inv_eng(struct amdgpu_device *adev)
                }
 
                ring->vm_inv_eng = inv_eng - 1;
-               change_bit(inv_eng - 1, (unsigned long *)(&vm_inv_engs[vmhub]));
+               change_bit(inv_eng - 1, &vm_inv_engs[vmhub]);</pre>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    Good catch, but wrong solution. We should just stop using change_bit
    to change the bitmask.<br>
    <br>
    E.g. use something like "vm_inv_engs[vmhub] &= ~(1 <<
    (inv_eng - 1));" here.<br>
    <br>
    Christian.<br>
    <br>
    <blockquote type="cite"
cite="mid:CALKDN1PRNNDMhNKYaNsFdkYCKM4R4tUtQ9svXdmPwBQL6=AzFA@mail.gmail.com">
      <div dir="ltr">
        <div>
          <div>
            <pre style="color:rgb(0,0,0);white-space:pre-wrap">
 
                dev_info(adev->dev, "ring %s uses VM inv eng %u on hub %u\n",
                         ring->name, ring->vm_inv_eng, ring->funcs->vmhub);</pre>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
amd-gfx mailing list
<a class="moz-txt-link-abbreviated" href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a></pre>
    </blockquote>
    <br>
  </body>
</html>