From patchwork Sun Dec 25 07:47:15 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: 36459 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp434366wrt; Sat, 24 Dec 2022 23:48:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXvSf3nuqFPr8YFGf5djhMdwoWA+T18zvP+PS34aEnLabGcakf0rJLT3+n1ofbT7kZseyUvI X-Received: by 2002:aa7:8bc8:0:b0:581:1542:217b with SMTP id s8-20020aa78bc8000000b005811542217bmr675270pfd.12.1671954517909; Sat, 24 Dec 2022 23:48:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671954517; cv=none; d=google.com; s=arc-20160816; b=Jm01CHnYzCNvxInKEXJS7IiSL3HkS7f3WNij/akBRjXSXOONCCBSPJfxti611YsshR G4ghNF+NdfW8TEWajbO+GWT4EB2aWtV8nhkZtyyeDbGP+uUvjQEWbR857jEpCZuYzrbZ UfeQZCMwXpwopEBlwqoB5goK4Aazwy0j3LBXYhCMKAgirzJV6Mxiy3auWtZmNjkOj+jk oOLJmwOrA0CzuqxFMrtXWs3p8SiANbMQEStnsEj2+EOjHr0O91tt0RH2Cnf4HPlKkd2Z 89Jpb/QAG6Ykhwed59T5KDgtY56OPXx2giXXhPTC9ONtd0WTTjnKLV5ZinH5oH18jpC3 pn8A== 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=gpMQe2Qto8T1C2lebHhK5UETQRmDRUtJhCi4RdfN3a4=; b=tf9MxosbvN3nG0o5x0z260YsuXvfdrLHLFOYnGI/usfYilE80PIGAwEsx8CTG6p+LI v4mn0p4wbgcJnq7AzsTj3X5e80Vg3f+3k+XBSv6imz2wqN3dbJ8ndj/Ma7eDyGTD7bFm OLzIrIC7FBUK4wuV23NyaAWAPRUdolVLMVwGsaPmZAuCeZE4T4DY07nXTsQU/l0y/bGG 3DrKvLakOSTgURY6JF6KE2f5YYIKMM97P3/Nfton10wTG+/Z8IXc/u3JtLqI+IfrGmRT O41wetNgG2qnOJDQ8NEu9D7MztYt/dIAslp9znLTws1Zg4YVxfUqYS7glRPAcTAs3Vzc 3FOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=WoKWM9Vv; 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 u11-20020a6540cb000000b0047860cd6de3si8430301pgp.641.2022.12.24.23.48.25; Sat, 24 Dec 2022 23:48:37 -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=WoKWM9Vv; 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 S229671AbiLYHrf (ORCPT + 99 others); Sun, 25 Dec 2022 02:47:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiLYHrc (ORCPT ); Sun, 25 Dec 2022 02:47:32 -0500 Received: from msg-4.mailo.com (msg-4.mailo.com [213.182.54.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB45F389 for ; Sat, 24 Dec 2022 23:47:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1671954441; bh=bMU9mUk6Hw98H87DEnX7EHpdpzuEKQ/x1ECaFF4/Tjs=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=WoKWM9VvSJNpSWwSlYreTc9B1hYNk1x3PboZuTaB1HhSe6SWVn/eicjg78bZIOy/W eTDiRPhAqEJMdNcqg15+KFVqfJj8WUd/eAXKSoQaBQl/F9rIjESa97M/TSHn9M2h/R IGRQu6SybExcB1yNLx1US6dnbdiz3bpfi5FeVIZk= 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:47:20 +0100 (CET) X-EA-Auth: AfL6MqEJGDGV6JwNRF6Xqw+evEf5XMzyYLv3rVlGa1tumfShUReZEyAisWYF+hg9A2xGSkVbcOSB4UUd+Q+csLUK2zJ/IhsQ Date: Sun, 25 Dec 2022 13:17:15 +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 1/2] drm/i915: convert i915_active.count from atomic_t to refcount_t Message-ID: 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?1753171380147779447?= X-GMAIL-MSGID: =?utf-8?q?1753171380147779447?= The refcount_* APIs are designed to address known issues with the atomic_t APIs for reference counting. They provide following distinct advantages: - protect the reference counters from overflow/underflow - avoid use-after-free errors - provide improved memory ordering guarantee schemes - neater and safer. Hence, convert the atomic_t count member variable and associated atomic_*() API calls to equivalent refcount_t type and refcount_*() API calls. This patch proposal address the following warnings generated by the atomic_as_refcounter.cocci coccinelle script atomic_add_unless Signed-off-by: Deepak R Varma --- Please note: 1. Proposed changes are compile tested only. 2. This patch 1/2 is required to be applied before patch 2/2 due to interdependency. Changes in v2: 1. Patch added to the patch series. 2. Handle build issues Reported-by: kernel test robot Earlier a standalone patch was sent for the i915 base driver only. The Kernel Test Robot reported build failure for additional atomic_*() calls specific to i915 debugging support when enabled. This version now includes those changes as well. drivers/gpu/drm/i915/i915_active.c | 28 +++++++++++++----------- drivers/gpu/drm/i915/i915_active.h | 6 ++--- drivers/gpu/drm/i915/i915_active_types.h | 4 ++-- 3 files changed, 20 insertions(+), 18 deletions(-) -- 2.34.1 diff --git a/drivers/gpu/drm/i915/i915_active.c b/drivers/gpu/drm/i915/i915_active.c index 7412abf166a8..5e58d8b1e947 100644 --- a/drivers/gpu/drm/i915/i915_active.c +++ b/drivers/gpu/drm/i915/i915_active.c @@ -92,14 +92,14 @@ 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 */ + if (!refcount_read(&ref->count)) /* before the first inc */ debug_object_activate(ref, &active_debug_desc); } static void debug_active_deactivate(struct i915_active *ref) { lockdep_assert_held(&ref->tree_lock); - if (!atomic_read(&ref->count)) /* after the last dec */ + if (!refcount_read(&ref->count)) /* after the last dec */ debug_object_deactivate(ref, &active_debug_desc); } @@ -133,7 +133,7 @@ __active_retire(struct i915_active *ref) GEM_BUG_ON(i915_active_is_idle(ref)); /* return the unused nodes to our slabcache -- flushing the allocator */ - if (!atomic_dec_and_lock_irqsave(&ref->count, &ref->tree_lock, flags)) + if (!refcount_dec_and_lock_irqsave(&ref->count, &ref->tree_lock, &flags)) return; GEM_BUG_ON(rcu_access_pointer(ref->excl.fence)); @@ -179,8 +179,8 @@ active_work(struct work_struct *wrk) { struct i915_active *ref = container_of(wrk, typeof(*ref), work); - GEM_BUG_ON(!atomic_read(&ref->count)); - if (atomic_add_unless(&ref->count, -1, 1)) + GEM_BUG_ON(!refcount_read(&ref->count)); + if (refcount_dec_not_one(&ref->count)) return; __active_retire(ref); @@ -189,8 +189,8 @@ active_work(struct work_struct *wrk) static void active_retire(struct i915_active *ref) { - GEM_BUG_ON(!atomic_read(&ref->count)); - if (atomic_add_unless(&ref->count, -1, 1)) + GEM_BUG_ON(!refcount_read(&ref->count)); + if (refcount_dec_not_one(&ref->count)) return; if (ref->flags & I915_ACTIVE_RETIRE_SLEEPS) { @@ -354,7 +354,7 @@ void __i915_active_init(struct i915_active *ref, ref->cache = NULL; init_llist_head(&ref->preallocated_barriers); - atomic_set(&ref->count, 0); + refcount_set(&ref->count, 0); __mutex_init(&ref->mutex, "i915_active", mkey); __i915_active_fence_init(&ref->excl, NULL, excl_retire); INIT_WORK(&ref->work, active_work); @@ -445,7 +445,7 @@ int i915_active_add_request(struct i915_active *ref, struct i915_request *rq) if (replace_barrier(ref, active)) { RCU_INIT_POINTER(active->fence, NULL); - atomic_dec(&ref->count); + refcount_dec(&ref->count); } if (!__i915_active_fence_set(active, fence)) __i915_active_acquire(ref); @@ -488,14 +488,16 @@ i915_active_set_exclusive(struct i915_active *ref, struct dma_fence *f) bool i915_active_acquire_if_busy(struct i915_active *ref) { debug_active_assert(ref); - return atomic_add_unless(&ref->count, 1, 0); + return refcount_add_not_zero(1, &ref->count); } static void __i915_active_activate(struct i915_active *ref) { spin_lock_irq(&ref->tree_lock); /* __active_retire() */ - if (!atomic_fetch_inc(&ref->count)) + if (!refcount_inc_not_zero(&ref->count)) { + refcount_inc(&ref->count); debug_active_activate(ref); + } spin_unlock_irq(&ref->tree_lock); } @@ -757,7 +759,7 @@ int i915_sw_fence_await_active(struct i915_sw_fence *fence, void i915_active_fini(struct i915_active *ref) { debug_active_fini(ref); - GEM_BUG_ON(atomic_read(&ref->count)); + GEM_BUG_ON(refcount_read(&ref->count)); GEM_BUG_ON(work_pending(&ref->work)); mutex_destroy(&ref->mutex); @@ -927,7 +929,7 @@ int i915_active_acquire_preallocate_barrier(struct i915_active *ref, first = first->next; - atomic_dec(&ref->count); + refcount_dec(&ref->count); intel_engine_pm_put(barrier_to_engine(node)); kmem_cache_free(slab_cache, node); diff --git a/drivers/gpu/drm/i915/i915_active.h b/drivers/gpu/drm/i915/i915_active.h index 7eb44132183a..116c7c28466a 100644 --- a/drivers/gpu/drm/i915/i915_active.h +++ b/drivers/gpu/drm/i915/i915_active.h @@ -193,14 +193,14 @@ void i915_active_release(struct i915_active *ref); static inline void __i915_active_acquire(struct i915_active *ref) { - GEM_BUG_ON(!atomic_read(&ref->count)); - atomic_inc(&ref->count); + GEM_BUG_ON(!refcount_read(&ref->count)); + refcount_inc(&ref->count); } static inline bool i915_active_is_idle(const struct i915_active *ref) { - return !atomic_read(&ref->count); + return !refcount_read(&ref->count); } void i915_active_fini(struct i915_active *ref); diff --git a/drivers/gpu/drm/i915/i915_active_types.h b/drivers/gpu/drm/i915/i915_active_types.h index b02a78ac87db..152a3a25d9f7 100644 --- a/drivers/gpu/drm/i915/i915_active_types.h +++ b/drivers/gpu/drm/i915/i915_active_types.h @@ -7,7 +7,7 @@ #ifndef _I915_ACTIVE_TYPES_H_ #define _I915_ACTIVE_TYPES_H_ -#include +#include #include #include #include @@ -23,7 +23,7 @@ struct i915_active_fence { struct active_node; struct i915_active { - atomic_t count; + refcount_t count; struct mutex mutex; spinlock_t tree_lock; 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)); }