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

Daniel Vetter daniel at ffwll.ch
Wed Jun 27 00:34:19 CEST 2012


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.
> In every manual I've found mutex_trylock(...) returns 0 on success.
> So

Qoting the kernel doc for mutex_trylock:

"Try to acquire the mutex atomically. Returns 1 if the mutex has been
acquired successfully, and 0 on contention."

Also, it's open-source, so you could double-check the implementation ...

-Daniel
-- 
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48



More information about the Intel-gfx mailing list