Re: [Intel-gfx] [PATCH 2/4] drm/i915: don't trylock in the gpu reset code

2012-06-26 Thread Daniel Vetter
On Wed, Jun 27, 2012 at 12:08:33AM +0200, Łukasz Kuryło wrote: > > > > -       if (!mutex_trylock(&dev->struct_mutex)) > > -               return -EBUSY; > > +       mutex_lock(&dev->struct_mutex); > > > >        i915_gem_reset(dev); > > > > But ... the original code: > > Correct me if I'm wrong.

Re: [Intel-gfx] [PATCH 2/4] drm/i915: don't trylock in the gpu reset code

2012-06-26 Thread Łukasz Kuryło
> > -       if (!mutex_trylock(&dev->struct_mutex)) > -               return -EBUSY; > +       mutex_lock(&dev->struct_mutex); > >        i915_gem_reset(dev); > But ... the original code: Correct me if I'm wrong. In every manual I've found mutex_trylock(...) returns 0 on success. So if(!mutex_tr

[Intel-gfx] [PATCH 2/4] drm/i915: don't trylock in the gpu reset code

2012-06-26 Thread Daniel Vetter
Simply failing to reset the gpu because someone else might still hold the mutex isn't a great idea - I see reliable silent reset failures. And gpu reset simply needs to be reliable and Just Work. "But ... the deadlocks!" We already kick all processes waiting for the gpu before launching the reset