From patchwork Mon Mar 13 11:46:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nirmoy Das X-Patchwork-Id: 13172342 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 8A6C1C6FD19 for ; Mon, 13 Mar 2023 11:46:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 19F7610E07E; Mon, 13 Mar 2023 11:46:28 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id A45E010E07E for ; Mon, 13 Mar 2023 11:46:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678707986; x=1710243986; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1bKhz2APsQ7pRCrgFQeTk+KExMU/Pn7W1lroGbmk+Pc=; b=VDsRAup7BUkdaO0sMR/T5ep663XqV6H9X84I2B32CrN9Cy19capcoC/Y sB0n5896rXY1PLmEkMoLv054J5y5+uQGffbmsNCnXMrWCegQqPUQPPuaZ 3sGVLuL8Wkr/VSPqPja2hXCrgKA4qyAxTApNjt6LVG5Yk/qmhPF5lMVRE Pj4hEaE+8M0d1ruT22scZaDse9eXj2qySkbfChSLtykbHqx95h+q54wiz Ee7HHY/cRHPG9VngUYmU6QzJ7qPTFODUvzy/+TI3diR/Hhdlq3wS+XjvW 7Zng9RQyEecoRq3brEnohvm3XrwnOeaGItlRdWRvX+ieFMe8sIxnRlYGE Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10647"; a="337146655" X-IronPort-AV: E=Sophos;i="5.98,256,1673942400"; d="scan'208";a="337146655" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Mar 2023 04:46:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10647"; a="681009991" X-IronPort-AV: E=Sophos;i="5.98,256,1673942400"; d="scan'208";a="681009991" Received: from nirmoyda-desk.igk.intel.com ([10.102.42.231]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Mar 2023 04:46:23 -0700 From: Nirmoy Das To: intel-gfx@lists.freedesktop.org Date: Mon, 13 Mar 2023 12:46:13 +0100 Message-Id: <20230313114613.9874-1-nirmoy.das@intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230313103045.8906-1-nirmoy.das@intel.com> References: <20230313103045.8906-1-nirmoy.das@intel.com> 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] 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. References: https://gitlab.freedesktop.org/drm/intel/-/issues/6733 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 --- 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)