[Intel-gfx] [PATCH] drm/i915/active: Fix missing debug object activation

Nirmoy Das nirmoy.das at intel.com
Fri Mar 10 14:11:38 UTC 2023


debug_active_activate() expected ref->count to be zero
which is not true anymore as __i915_active_activate() calls
debug_active_activate() after incrementing the count.

Fixes: 04240e30ed06 ("drm/i915: Skip taking acquire mutex for no ref->active callback")
Cc: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Cc: Thomas Hellström <thomas.hellstrom at intel.com>
Cc: Andi Shyti <andi.shyti at linux.intel.com>
Cc: intel-gfx at lists.freedesktop.org
Cc: <stable at vger.kernel.org> # v5.10+
Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
---
 drivers/gpu/drm/i915/i915_active.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_active.c b/drivers/gpu/drm/i915/i915_active.c
index a9fea115f2d2..1c3066eb359a 100644
--- a/drivers/gpu/drm/i915/i915_active.c
+++ b/drivers/gpu/drm/i915/i915_active.c
@@ -92,7 +92,7 @@ static void debug_active_init(struct i915_active *ref)
 static void debug_active_activate(struct i915_active *ref)
 {
 	lockdep_assert_held(&ref->tree_lock);
-	if (!atomic_read(&ref->count)) /* before the first inc */
+	if (atomic_read(&ref->count) == 1) /* after the first inc */
 		debug_object_activate(ref, &active_debug_desc);
 }
 
-- 
2.39.0



More information about the Intel-gfx mailing list