From nobody Wed Sep 17 03:19:53 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2C68C10F1D for ; Sun, 25 Dec 2022 07:48:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230056AbiLYHsZ (ORCPT ); Sun, 25 Dec 2022 02:48:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiLYHsX (ORCPT ); Sun, 25 Dec 2022 02:48:23 -0500 Received: from msg-1.mailo.com (msg-1.mailo.com [213.182.54.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F33C63DA for ; Sat, 24 Dec 2022 23:48:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1671954490; bh=aBta368pCzAXtdUGLmcTgKPtuQS+E+6V5AUDhc5bAYg=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=Yb4s9iD8tadJFgSm4v5UFdKvDkq10qjgFGfAIIPbyK+bxyf3nwKeqxyN7pdDwghwd Km/v/eEVcA7iSWFbDql4qNYLmQBQ0LlvqdRpSexEE3LFrIvFpOGXH0g2MjTLOC24ID cwoUsW3Y3AqB+wp2E0ME/ENz8kF0N+R0Xxfj7+mc= Received: by b-6.in.mailobj.net [192.168.90.16] with ESMTP via ip-206.mailobj.net [213.182.55.206] Sun, 25 Dec 2022 08:48:10 +0100 (CET) X-EA-Auth: NixFvOfkNIjC/V/jyidk3xF9ifjT9WgqJGK5iP0nd0HTff1Tpd/mTcntT0tjjTYLbIT+FAfQOfJhuMAHEzlVq6dnT+wDu5c9 Date: Sun, 25 Dec 2022 13:18:05 +0530 From: Deepak R Varma To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar , Praveen Kumar , Deepak R Varma Subject: [PATCH v2 2/2] drm/i915/selftests: Convert atomic_* API calls for i915_active.count refcount_* Message-ID: <1cce7ada5c91f81f9b3d6b2d68eb7fda4dd9fbf7.1671952191.git.drv@mailo.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Handle the struct i915_active member variable count transition from atomic_t type to refcount_t type for selftest use cases. Transition the atomic_*() API calls to their equivalent refcount_*() API calls. Reported-by: kernel test robot Signed-off-by: Deepak R Varma --- Please note: 1. Proposed changes are compile tested only. 2. This patch 2/2 is required to be applied after patch 1/2 due to inter dependency. Changes in v2: 1. Patch added to patch series. 2. Handle build issues Reported-by: kernel test robot Include changes for i915/selftests use cases for atomic_* to refcount= _* transition. drivers/gpu/drm/i915/selftests/i915_active.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/selftests/i915_active.c b/drivers/gpu/drm= /i915/selftests/i915_active.c index b61fe850e924..f1eca59e0180 100644 --- a/drivers/gpu/drm/i915/selftests/i915_active.c +++ b/drivers/gpu/drm/i915/selftests/i915_active.c @@ -125,9 +125,9 @@ __live_active_setup(struct drm_i915_private *i915) pr_err("i915_active retired before submission!\n"); err =3D -EINVAL; } - if (atomic_read(&active->base.count) !=3D count) { + if (refcount_read(&active->base.count) !=3D count) { pr_err("i915_active not tracking all requests, found %d, expected %d\n", - atomic_read(&active->base.count), count); + refcount_read(&active->base.count), count); err =3D -EINVAL; } @@ -279,7 +279,7 @@ static struct intel_engine_cs *node_to_barrier(struct a= ctive_node *it) void i915_active_print(struct i915_active *ref, struct drm_printer *m) { drm_printf(m, "active %ps:%ps\n", ref->active, ref->retire); - drm_printf(m, "\tcount: %d\n", atomic_read(&ref->count)); + drm_printf(m, "\tcount: %d\n", refcount_read(&ref->count)); drm_printf(m, "\tpreallocated barriers? %s\n", str_yes_no(!llist_empty(&ref->preallocated_barriers))); @@ -324,7 +324,7 @@ static void active_flush(struct i915_active *ref, spin_lock_irq(fence->lock); __list_del_entry(&active->cb.node); spin_unlock_irq(fence->lock); /* serialise with fence->cb_list */ - atomic_dec(&ref->count); + refcount_dec(&ref->count); GEM_BUG_ON(!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)); } -- 2.34.1