From patchwork Mon Mar 13 10:30:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nirmoy Das X-Patchwork-Id: 13172176 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6F2C4C6FD19 for ; Mon, 13 Mar 2023 10:30:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DEE3B10E07B; Mon, 13 Mar 2023 10:30:55 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id CB44B10E4CD for ; Mon, 13 Mar 2023 10:30:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678703452; x=1710239452; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=sMk0eO3EmOgEh9qjVHHQT+6MoVaryNzsDDU8Ds0R08s=; b=CT1RGNj4v+W2qlcB58wwcKz6/W6LWJFSOH2Eq2PoGCTFc/6YFRW67Oeo REi0U1+eqiOHnXpxLx/kEfdcK/JUR0iDz3/AgJjErnYNmQnrsuBonwqCH vlmbGZkYJax+e7jIE+rfQl2R/27+EaWJjZprWkpN78DZ6Kr8wjeMxmIUV qGFs4akaFjqfM2i8Vkvi6naYbdoiiO/xMKzPZBBu3fhBybvK+vcM44f2m m+Pe7uBFU0h6PyYFauZodBe1OY71+NhYx9Hmip1C8ZmRTgdofpiw+M+wK 71Y/TC54jWSUaVWjkQgUh8DSQayZqRLh9MMLt8lmuR+lCHAILXE8k7Kwa A==; X-IronPort-AV: E=McAfee;i="6500,9779,10647"; a="325469780" X-IronPort-AV: E=Sophos;i="5.98,256,1673942400"; d="scan'208";a="325469780" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Mar 2023 03:30:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10647"; a="708835892" X-IronPort-AV: E=Sophos;i="5.98,256,1673942400"; d="scan'208";a="708835892" Received: from nirmoyda-desk.igk.intel.com ([10.102.42.231]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Mar 2023 03:30:50 -0700 From: Nirmoy Das To: intel-gfx@lists.freedesktop.org Date: Mon, 13 Mar 2023 11:30:45 +0100 Message-Id: <20230313103045.8906-1-nirmoy.das@intel.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Organization: Intel Deutschland GmbH, Registered Address: Am Campeon 10, 85579 Neubiberg, Germany, Commercial Register: Amtsgericht Muenchen HRB 186928 Subject: [Intel-gfx] [PATCH v2] drm/i915/active: Fix missing debug object activation X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stable@vger.kernel.org, Chris Wilson , =?utf-8?q?Thomas_Hellstr=C3=B6m?= , Nirmoy Das Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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. Fixes: 04240e30ed06 ("drm/i915: Skip taking acquire mutex for no ref->active callback") Cc: Chris Wilson Cc: Tvrtko Ursulin Cc: Thomas Hellström Cc: Andi Shyti Cc: intel-gfx@lists.freedesktop.org Cc: Janusz Krzysztofik Cc: # v5.10+ Signed-off-by: Nirmoy Das Reviewed-by: Janusz Krzysztofik Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/i915/i915_active.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_active.c b/drivers/gpu/drm/i915/i915_active.c index a9fea115f2d2..8ef93889061a 100644 --- a/drivers/gpu/drm/i915/i915_active.c +++ b/drivers/gpu/drm/i915/i915_active.c @@ -92,8 +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 */ - debug_object_activate(ref, &active_debug_desc); + debug_object_activate(ref, &active_debug_desc); } static void debug_active_deactivate(struct i915_active *ref)