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

Greg Kroah-Hartman gregkh at linuxfoundation.org
Mon Apr 3 14:08:25 UTC 2023


From: Nirmoy Das <nirmoy.das at intel.com>

commit e92eb246feb9019b0b137706c934b8891cdfe3c2 upstream.

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.

v2: No need to check for "ref->count == 1" as __i915_active_activate()
already make sure of that(Janusz).

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: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>
Cc: <stable at vger.kernel.org> # v5.10+
Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
Reviewed-by: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>
Reviewed-by: Andrzej Hajda <andrzej.hajda at intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230313114613.9874-1-nirmoy.das@intel.com
(cherry picked from commit bfad380c542438a9b642f8190b7fd37bc77e2723)
Signed-off-by: Jani Nikula <jani.nikula at intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
 drivers/gpu/drm/i915/i915_active.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/gpu/drm/i915/i915_active.c
+++ b/drivers/gpu/drm/i915/i915_active.c
@@ -96,8 +96,7 @@ static void debug_active_init(struct i91
 static void debug_active_activate(struct i915_active *ref)
 {
 	lockdep_assert_held(&ref->tree_lock);
-	if (!atomic_read(&ref->count)) /* before the first inc */
-		debug_object_activate(ref, &active_debug_desc);
+	debug_object_activate(ref, &active_debug_desc);
 }
 
 static void debug_active_deactivate(struct i915_active *ref)




More information about the Intel-gfx mailing list