gnome-shell stuck because of amdgpu driver [5.3 RC5]

Hillf Danton hdanton at sina.com
Fri Aug 30 03:29:48 UTC 2019


On Fri, 30 Aug 2019 06:04:06 +0800 Mikhail Gavrilov wrote:
> On Sun, Aug 25, 2019 at 10:13:05PM +0800, Hillf Danton wrote:
> > Can we try to add the fallback timer manually?
> >
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> > @@ -322,6 +322,10 @@ int amdgpu_fence_wait_empty(struct amdgp
> >         }
> >         rcu_read_unlock();
> > 
> > +       if (!timer_pending(&ring->fence_drv.fallback_timer))
> > +               mod_timer(&ring->fence_drv.fallback_timer,
> > +                       jiffies + (AMDGPU_FENCE_JIFFIES_TIMEOUT << 1));
> > +
> >         r = dma_fence_wait(fence, false);
> >         dma_fence_put(fence);
> >         return r;
> > --
> >
> > Or simply wait with an ear on signal and timeout if adding timer
> > seems to go a bit too far?
> >
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> > @@ -322,7 +322,12 @@ int amdgpu_fence_wait_empty(struct amdgp
> >         }
> >         rcu_read_unlock();
> > 
> > -       r = dma_fence_wait(fence, false);
> > +       if (0 < dma_fence_wait_timeout(fence, true,
> > +                               AMDGPU_FENCE_JIFFIES_TIMEOUT +
> > +                               (AMDGPU_FENCE_JIFFIES_TIMEOUT >> 3)))
> > +               r = 0;
> > +       else
> > +               r = -EINVAL;
> >         dma_fence_put(fence);

		WARN(r, "gnome shell stuck warning\n");

> >         return r;
> >  }
> 
> I tested both patches on top of 5.3 RC6. Each patch I was tested more
> than 24 hours and I don't seen any regressions or problems with them.
> 
Add a warning to show if it makes sense in field: neither regression nor
problem will have been observed with the warning printed.

Thanks
Hillf



More information about the amd-gfx mailing list