Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp474144rwl; Sun, 25 Dec 2022 00:45:47 -0800 (PST) X-Google-Smtp-Source: AMrXdXu5lcHOwvjpBh3EhdlPKnrNsMJmfPNNUqemPqhEgIkMvSCHGCdCKhb9pjTlJKVIuomVAMzj X-Received: by 2002:a17:902:e944:b0:189:d8fb:1523 with SMTP id b4-20020a170902e94400b00189d8fb1523mr18272689pll.36.1671957947541; Sun, 25 Dec 2022 00:45:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671957947; cv=none; d=google.com; s=arc-20160816; b=Dd4TpfAfXivgUKhLswNPGdVqU4XEayHKqapAmPydMU6PnXmSx7SDDxp1kOXgALiDYv NHGWWkNifW4XYC4dthStH6tfYLxdgaLRuVpo8kH5Wl+OoVdty5FhpGjIruJmfpLR37V6 J9g7+h1R2QG8DxOhOZ03ehnfmBkfGPCK8U/8iTs0ArUWuD9+zovzWJegBRqPR0VlAJ+E 7zhmp5q0VumzZhZHcRVmC1UNGatxM3RanqpHMdfFpbSKtacV9Z9oDWyMgJfw4hpVmZmx 5E3qWkKxRLpV5zqrSItlKIOpqmHBFy5RVkUa0M6ZSXq0xql12qQl4n72PBN2dpMU48AC +CsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+Y9J0SAyymi9eAD2aZkCoK0VXjnbaAitAKkoAeRDRE8=; b=MZnIBk/AJbNFwIuH2KxbQ0OSZpgZB7286OnQFNwjqdmY03LfUT081JAHf3WHz4rB4y bzux6ud9QBoKwKxPeu28+jlNdv5c4c4YasgN8q7mMNHlGLFl/Hkh3KWPeO784dfoykmQ +CGpHKA/btfv/CULYdTQScAOWzwAmOAZU+weaIdQYp6oPHSaw6d0vfD/3rBVhUOhajPV /2dlRW7jBru4QtB02VRfke6aVquUbBV3WG5bfYAx6nWYlnZuFuOHET8Jbb55UKuvH9L2 ONn+ZJexUUOIy6QlL5b7IcSLOrZPJhGOTdkpo4b1OKqRdU3H6vqhhJYuum2kVmRfauMc GUJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=Yb4s9iD8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y16-20020a170902b49000b00188f4d824a2si7611249plr.241.2022.12.25.00.45.28; Sun, 25 Dec 2022 00:45:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=Yb4s9iD8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229969AbiLYHsY (ORCPT + 66 others); Sun, 25 Dec 2022 02:48:24 -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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 = -EINVAL; } - if (atomic_read(&active->base.count) != count) { + if (refcount_read(&active->base.count) != 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 = -EINVAL; } @@ -279,7 +279,7 @@ static struct intel_engine_cs *node_to_barrier(struct active_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