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

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

 



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


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