Re: 回复: [PATCH] drm/amdgpu: fix losting fence signal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yeah, but this must have another reason.

If we loose fences the system would just hang and not continue at all.

Christian.

Am 22.06.2016 um 14:29 schrieb Zhou, David(ChunMing):
> David Mao reported amd_sched_process doesn't balance with cs_ioctl, 
> you should see that thread.
>
> Regards,
> David Zhou
>
> Sent from my Huawei Mobile
>
> -------- å??å§?é?®ä»¶ --------
> 主��Re: [PATCH] drm/amdgpu: fix losting fence signal
> å??件人ï¼?Christian Ké°?ig
> �件人�"Zhou, David(ChunMing)" ,amd-gfx at lists.freedesktop.org
> æ??é??ï¼?"Mao, David"
>
> Am 22.06.2016 um 08:58 schrieb Chunming Zhou:
> > Change-Id: Ibfb7e8af796cc178dfb40d8aaabda472de3c5eda
> > Signed-off-by: Chunming Zhou <David1.Zhou at amd.com>
>
> NAK, this could lead to a situation where we try to signal a fence twice.
>
> Why do you think that we would loose fences otherwise?
>
> Regards,
> Christian.
>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 7 ++++---
> >   1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> > index 17bd5af..6a69336 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> > @@ -192,9 +192,10 @@ static void 
> amdgpu_fence_schedule_fallback(struct amdgpu_ring *ring)
> >   void amdgpu_fence_process(struct amdgpu_ring *ring)
> >   {
> >        struct amdgpu_fence_driver *drv = &ring->fence_drv;
> > -     uint32_t seq, last_seq;
> > +     uint32_t seq, last_seq, old_seq;
> >        int r;
> >
> > +     old_seq = atomic_read(&ring->fence_drv.last_seq);
> >        do {
> >                last_seq = atomic_read(&ring->fence_drv.last_seq);
> >                seq = amdgpu_fence_read(ring);
> > @@ -204,10 +205,10 @@ void amdgpu_fence_process(struct amdgpu_ring 
> *ring)
> >        if (seq != ring->fence_drv.sync_seq)
> >                amdgpu_fence_schedule_fallback(ring);
> >
> > -     while (last_seq != seq) {
> > +     while (old_seq != seq) {
> >                struct fence *fence, **ptr;
> >
> > -             ptr = &drv->fences[++last_seq & drv->num_fences_mask];
> > +             ptr = &drv->fences[++old_seq & drv->num_fences_mask];
> >
> >                /* There is always exactly one thread signaling this 
> fence slot */
> >                fence = rcu_dereference_protected(*ptr, 1);
>
>
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20160622/e524d176/attachment.html>


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux