<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Thanks for your reply.<br>
    <br>
    <div class="moz-cite-prefix">On 2018/9/15 17:01, Koenig, Christian
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:3fe8b580-e94c-42bc-a4f8-54d8d44cbda2@email.android.com">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Exchange Server">
      <!-- converted from text -->
      <style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
      <div>
        <div dir="auto">Sorry to say that but your analysis tool is
          buggy.
          <div dir="auto"><br>
          </div>
          <div dir="auto">The proposed call paths will never trigger.</div>
        </div>
      </div>
    </blockquote>
    <br>
    Could you please explain which piece of the call path is incorrect?<br>
    I am not very sure of my function pointer analysis.<br>
    Does amdgpu_ring_alloc() never calls amdgpu_uvd_ring_begin_use()?<br>
    <br>
    Thanks in advance.<br>
    <br>
    <br>
    Best wishes,<br>
    Jia-Ju Bai<br>
    <br>
    <blockquote type="cite"
      cite="mid:3fe8b580-e94c-42bc-a4f8-54d8d44cbda2@email.android.com">
      <div>
        <div dir="auto">
          <div dir="auto"><br>
          </div>
          <div dir="auto">Regards,</div>
          <div dir="auto">Christian.</div>
        </div>
        <div class="x_gmail_extra"><br>
          <div class="x_gmail_quote">Am 15.09.2018 10:59 schrieb Jia-Ju
            Bai <a class="moz-txt-link-rfc2396E" href="mailto:baijiaju1990@gmail.com"><baijiaju1990@gmail.com></a>:<br type="attribution">
          </div>
        </div>
      </div>
      <font size="2"><span style="font-size:11pt;">
          <div class="PlainText">The driver may sleep with holding a
            spinlock.<br>
            The function call paths (from bottom to top) in Linux-4.17
            are:<br>
            <br>
            [FUNC] mutex_lock_nested<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c, 1477:<br>
                 mutex_lock_nested in amdgpu_dpm_enable_uvd<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c, 1154:<br>
                 amdgpu_dpm_enable_uvd in amdgpu_uvd_ring_begin_use<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c, 80:<br>
                 [FUNC_PTR]amdgpu_uvd_ring_begin_use in
            amdgpu_ring_alloc<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c, 199:<br>
                 amdgpu_ring_alloc in amdgpu_virt_kiq_wreg<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_device.c, 207:<br>
                 amdgpu_virt_kiq_wreg in amdgpu_mm_wreg<br>
            drivers/gpu/drm/amd/amdgpu/vi.c, 207:<br>
                 amdgpu_mm_wreg in vi_gc_cac_rreg<br>
            drivers/gpu/drm/amd/amdgpu/vi.c, 206:<br>
                 _raw_spin_lock_irqsave in vi_gc_cac_rreg<br>
            <br>
            [FUNC] mutex_lock_nested<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c, 1477:<br>
                 mutex_lock_nested in amdgpu_dpm_enable_uvd<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c, 1154:<br>
                 amdgpu_dpm_enable_uvd in amdgpu_uvd_ring_begin_use<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c, 80:<br>
                 [FUNC_PTR]amdgpu_uvd_ring_begin_use in
            amdgpu_ring_alloc<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c, 199:<br>
                 amdgpu_ring_alloc in amdgpu_virt_kiq_wreg<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_device.c, 207:<br>
                 amdgpu_virt_kiq_wreg in amdgpu_mm_wreg<br>
            drivers/gpu/drm/amd/amdgpu/soc15.c, 106:<br>
                 amdgpu_mm_wreg in soc15_pcie_rreg<br>
            drivers/gpu/drm/amd/amdgpu/soc15.c, 105:<br>
                 _raw_spin_lock_irqsave in soc15_pcie_rreg<br>
            <br>
            [FUNC] mutex_lock_nested<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c, 1477:<br>
                 mutex_lock_nested in amdgpu_dpm_enable_uvd<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c, 1154:<br>
                 amdgpu_dpm_enable_uvd in amdgpu_uvd_ring_begin_use<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c, 80:<br>
                 [FUNC_PTR]amdgpu_uvd_ring_begin_use in
            amdgpu_ring_alloc<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c, 199:<br>
                 amdgpu_ring_alloc in amdgpu_virt_kiq_wreg<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_device.c, 207:<br>
                 amdgpu_virt_kiq_wreg in amdgpu_mm_wreg<br>
            drivers/gpu/drm/amd/amdgpu/cik.c, 139:<br>
                 amdgpu_mm_wreg in cik_uvd_ctx_wreg<br>
            drivers/gpu/drm/amd/amdgpu/cik.c, 138:<br>
                 _raw_spin_lock_irqsave in cik_uvd_ctx_wreg<br>
            <br>
            [FUNC] mutex_lock_nested<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c, 1477:<br>
                 mutex_lock_nested in amdgpu_dpm_enable_uvd<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c, 1154:<br>
                 amdgpu_dpm_enable_uvd in amdgpu_uvd_ring_begin_use<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c, 80:<br>
                 [FUNC_PTR]amdgpu_uvd_ring_begin_use in
            amdgpu_ring_alloc<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c, 199:<br>
                 amdgpu_ring_alloc in amdgpu_virt_kiq_wreg<br>
            drivers/gpu/drm/amd/amdgpu/amdgpu_device.c, 207:<br>
                 amdgpu_virt_kiq_wreg in amdgpu_mm_wreg<br>
            drivers/gpu/drm/amd/amdgpu/dce_v6_0.c, 126:<br>
                 amdgpu_mm_wreg in dce_v6_0_audio_endpt_rreg<br>
            drivers/gpu/drm/amd/amdgpu/dce_v6_0.c, 125:<br>
                 _raw_spin_lock_irqsave in dce_v6_0_audio_endpt_rreg<br>
            <br>
            Note that [FUNC_PTR] means a function pointer call is used.<br>
            <br>
            These bugs are found by my static analysis tool DSAC.<br>
            <br>
            <br>
            Best wishes,<br>
            Jia-Ju Bai<br>
          </div>
        </span></font>
    </blockquote>
    <br>
  </body>
</html>