From patchwork Sun Dec 25 07:48:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak R Varma X-Patchwork-Id: 36460 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp446752wrt; Sun, 25 Dec 2022 00:45:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXtgWbXiv8Co8Xitw9QgvJ30vkn1bPjW/dpNhBcWQR+LjAzFIpLrYmkSn18JOotZdC29dR93 X-Received: by 2002:a17:902:ce02:b0:18f:a5b6:54f9 with SMTP id k2-20020a170902ce0200b0018fa5b654f9mr17214778plg.11.1671957901728; Sun, 25 Dec 2022 00:45:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671957901; cv=none; d=google.com; s=arc-20160816; b=GLs8CoR2onVGNSlyRjKZxTETGsfYgaVnQ47IhuUsNY37K3oZYk7dWszTHRPxfmbKAt PKcs8ncUS2/YwBavnr3mGyBkKqy+0UIoln4GErF3lhTl7eBQmaQi+JqzKbA1HQG+W6a+ QuAtIQa91fm2v93sCx0OswbjT8pQDD2tHJ0HkRuKvSUQmSFtQyDOE3hfc88KGnTPu4of A4Vm6KPmD6RnuojKACjRbc+jlLQhDV96ULqNX/jIH6jcYvqL6702B+uAUpxGU1EBrgSp Gb8DD7HAFUdqdKfeMXuxeg+v0bwKCDvmLTcMTYcs3zCFsP16JDNYR2FunTn+7zIY6S0P JUPg== 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 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.44.40; Sun, 25 Dec 2022 00:45:01 -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 + 99 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-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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753174928337444684?= X-GMAIL-MSGID: =?utf-8?q?1753174928337444684?= 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(-) -- 2.34.1 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)); }