public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 2/2] dma-resv: Fix dma_resv_held
Date: Fri, 25 Feb 2022 17:41:18 +0000	[thread overview]
Message-ID: <20220225174118.1320237-2-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <20220225174118.1320237-1-tvrtko.ursulin@linux.intel.com>

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Avoid false positives if lock state is unknown.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 include/linux/dma-resv.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/dma-resv.h b/include/linux/dma-resv.h
index afdfdfac729f..f475814c0d7a 100644
--- a/include/linux/dma-resv.h
+++ b/include/linux/dma-resv.h
@@ -278,7 +278,8 @@ static inline bool dma_resv_iter_is_restarted(struct dma_resv_iter *cursor)
 	     fence = dma_resv_iter_first(cursor); fence;	\
 	     fence = dma_resv_iter_next(cursor))
 
-#define dma_resv_held(obj) lockdep_is_held(&(obj)->lock.base)
+#define dma_resv_held(obj) \
+	(lockdep_is_held(&(obj)->lock.base) == LOCK_STATE_HELD)
 #define dma_resv_assert_held(obj) lockdep_assert_held(&(obj)->lock.base)
 
 #ifdef CONFIG_DEBUG_MUTEXES
-- 
2.32.0


  reply	other threads:[~2022-02-25 17:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-25 17:41 [Intel-gfx] [PATCH 1/2] drm/i915: Fix assert in i915_ggtt_pin Tvrtko Ursulin
2022-02-25 17:41 ` Tvrtko Ursulin [this message]
2022-02-25 17:58 ` Ville Syrjälä
2022-02-28 10:23   ` Tvrtko Ursulin
2022-02-25 23:23 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] " Patchwork
2022-02-25 23:25 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-02-25 23:52 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-02-26 23:20 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

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=20220225174118.1320237-2-tvrtko.ursulin@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox