<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Yeah, but this must have another
      reason.<br>
      <br>
      If we loose fences the system would just hang and not continue at
      all.<br>
      <br>
      Christian.<br>
      <br>
      Am 22.06.2016 um 14:29 schrieb Zhou, David(ChunMing):<br>
    </div>
    <blockquote
cite="mid:CY1PR12MB075999BD9E02AEBB026E204AB42C0@CY1PR12MB0759.namprd12.prod.outlook.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <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>David Mao reported amd_sched_process doesn't balance with
        cs_ioctl, you should see that thread.<br>
        <br>
        Regards,<br>
        David Zhou<br>
        <br>
        Sent from my Huawei Mobile<br>
        <br>
        -------- 原始邮件 --------<br>
        主题:Re: [PATCH] drm/amdgpu: fix losting fence signal<br>
        发件人:Christian K鰊ig <br>
        收件人:"Zhou, David(ChunMing)" ,<a class="moz-txt-link-abbreviated" href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
        抄送:"Mao, David" <br>
        <br>
      </div>
      <font size="2"><span style="font-size:10pt;">
          <div class="PlainText">Am 22.06.2016 um 08:58 schrieb Chunming
            Zhou:<br>
            > Change-Id: Ibfb7e8af796cc178dfb40d8aaabda472de3c5eda<br>
            > Signed-off-by: Chunming Zhou
            <a class="moz-txt-link-rfc2396E" href="mailto:David1.Zhou@amd.com"><David1.Zhou@amd.com></a><br>
            <br>
            NAK, this could lead to a situation where we try to signal a
            fence twice.<br>
            <br>
            Why do you think that we would loose fences otherwise?<br>
            <br>
            Regards,<br>
            Christian.<br>
            <br>
            > ---<br>
            >   drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 7 ++++---<br>
            >   1 file changed, 4 insertions(+), 3 deletions(-)<br>
            ><br>
            > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
            b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c<br>
            > index 17bd5af..6a69336 100644<br>
            > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c<br>
            > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c<br>
            > @@ -192,9 +192,10 @@ static void
            amdgpu_fence_schedule_fallback(struct amdgpu_ring *ring)<br>
            >   void amdgpu_fence_process(struct amdgpu_ring *ring)<br>
            >   {<br>
            >        struct amdgpu_fence_driver *drv =
            &ring->fence_drv;<br>
            > -     uint32_t seq, last_seq;<br>
            > +     uint32_t seq, last_seq, old_seq;<br>
            >        int r;<br>
            >   <br>
            > +     old_seq =
            atomic_read(&ring->fence_drv.last_seq);<br>
            >        do {<br>
            >                last_seq =
            atomic_read(&ring->fence_drv.last_seq);<br>
            >                seq = amdgpu_fence_read(ring);<br>
            > @@ -204,10 +205,10 @@ void amdgpu_fence_process(struct
            amdgpu_ring *ring)<br>
            >        if (seq != ring->fence_drv.sync_seq)<br>
            >                amdgpu_fence_schedule_fallback(ring);<br>
            >   <br>
            > -     while (last_seq != seq) {<br>
            > +     while (old_seq != seq) {<br>
            >                struct fence *fence, **ptr;<br>
            >   <br>
            > -             ptr = &drv->fences[++last_seq
            & drv->num_fences_mask];<br>
            > +             ptr = &drv->fences[++old_seq &
            drv->num_fences_mask];<br>
            >   <br>
            >                /* There is always exactly one thread
            signaling this fence slot */<br>
            >                fence = rcu_dereference_protected(*ptr,
            1);<br>
            <br>
          </div>
        </span></font>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <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>