From: Daniel Vetter <daniel@ffwll.ch>
To: "Łukasz Kuryło" <lukasz.kurylo@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 2/4] drm/i915: don't trylock in the gpu reset code
Date: Wed, 27 Jun 2012 00:34:19 +0200 [thread overview]
Message-ID: <20120626223419.GC5072@phenom.ffwll.local> (raw)
In-Reply-To: <CA+jNtFqOrdES3kQfQANqjzAysB7Smp2RW_9EdvfPiDDPvqG4CA@mail.gmail.com>
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@ffwll.ch
Mobile: +41 (0)79 365 57 48
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2012-06-26 22:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-26 21:08 [PATCH 1/4] drm/i915: don't return a spurious -EIO from intel_ring_begin Daniel Vetter
2012-06-26 21:08 ` [PATCH 2/4] drm/i915: don't trylock in the gpu reset code Daniel Vetter
2012-06-26 22:08 ` Łukasz Kuryło
2012-06-26 22:34 ` Daniel Vetter [this message]
2012-06-26 21:08 ` [PATCH 3/4] drm/i915: non-interruptible sleeps can't handle -EGAIN Daniel Vetter
2012-06-27 15:19 ` Ben Widawsky
2012-06-27 16:36 ` Daniel Vetter
2012-06-26 21:08 ` [PATCH 4/4] drm/i915: don't hange userspace when the gpu reset is stuck Daniel Vetter
2012-07-01 3:09 ` [PATCH 1/4] drm/i915: don't return a spurious -EIO from intel_ring_begin Ben Widawsky
2012-07-01 10:41 ` Daniel Vetter
2012-07-02 16:04 ` Ben Widawsky
2012-07-02 16:47 ` Daniel Vetter
2012-07-03 15:59 ` Chris Wilson
2012-07-03 18:11 ` Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120626223419.GC5072@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=daniel.vetter@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=lukasz.kurylo@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.