lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 25 Dec 2022 13:18:05 +0530
From:   Deepak R Varma <drv@...lo.com>
To:     Jani Nikula <jani.nikula@...ux.intel.com>,
        Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
        Rodrigo Vivi <rodrigo.vivi@...el.com>,
        Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>,
        David Airlie <airlied@...il.com>,
        Daniel Vetter <daniel@...ll.ch>,
        intel-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org
Cc:     Saurabh Singh Sengar <ssengar@...rosoft.com>,
        Praveen Kumar <kumarpraveen@...ux.microsoft.com>,
        Deepak R Varma <drv@...lo.com>
Subject: [PATCH v2 2/2] drm/i915/selftests: Convert atomic_* API calls for
 i915_active.count refcount_*

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 <lkp@...el.com>
Signed-off-by: Deepak R Varma <drv@...lo.com>
---
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 <lkp@...el.com>
      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



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ