summaryrefslogtreecommitdiff
path: root/sys/external
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2022-04-09 23:44:44 +0000
committerriastradh <riastradh@NetBSD.org>2022-04-09 23:44:44 +0000
commita9179b1b8ff7cf92fecc229e2ae4cbe07caa263a (patch)
tree0e00d15a1a3288868c39e9daa2162377248ad6f6 /sys/external
parent03dd4f2e5ebd0a786fa4051069bd7361df790fdb (diff)
drm: Convert membar_enter/exit stragglers to membar_acquire/release.
Diffstat (limited to 'sys/external')
-rw-r--r--sys/external/bsd/drm2/linux/linux_dma_buf.c8
-rw-r--r--sys/external/bsd/drm2/linux/linux_dma_fence.c8
-rw-r--r--sys/external/bsd/drm2/linux/linux_dma_fence_chain.c6
3 files changed, 11 insertions, 11 deletions
diff --git a/sys/external/bsd/drm2/linux/linux_dma_buf.c b/sys/external/bsd/drm2/linux/linux_dma_buf.c
index 4acccf3b490..ab98eb806a5 100644
--- a/sys/external/bsd/drm2/linux/linux_dma_buf.c
+++ b/sys/external/bsd/drm2/linux/linux_dma_buf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_dma_buf.c,v 1.14 2022/02/17 01:38:38 riastradh Exp $ */
+/* $NetBSD: linux_dma_buf.c,v 1.15 2022/04/09 23:44:44 riastradh Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_dma_buf.c,v 1.14 2022/02/17 01:38:38 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_dma_buf.c,v 1.15 2022/04/09 23:44:44 riastradh Exp $");
#include <sys/types.h>
#include <sys/atomic.h>
@@ -160,10 +160,10 @@ void
dma_buf_put(struct dma_buf *dmabuf)
{
- membar_exit();
+ membar_release();
if (atomic_dec_uint_nv(&dmabuf->db_refcnt) != 0)
return;
- membar_enter();
+ membar_acquire();
dma_resv_poll_fini(&dmabuf->db_resv_poll);
mutex_destroy(&dmabuf->db_lock);
diff --git a/sys/external/bsd/drm2/linux/linux_dma_fence.c b/sys/external/bsd/drm2/linux/linux_dma_fence.c
index 9f1a2ad96da..32d57b2977f 100644
--- a/sys/external/bsd/drm2/linux/linux_dma_fence.c
+++ b/sys/external/bsd/drm2/linux/linux_dma_fence.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_dma_fence.c,v 1.39 2021/12/19 12:39:40 riastradh Exp $ */
+/* $NetBSD: linux_dma_fence.c,v 1.40 2022/04/09 23:44:44 riastradh Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_dma_fence.c,v 1.39 2021/12/19 12:39:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_dma_fence.c,v 1.40 2022/04/09 23:44:44 riastradh Exp $");
#include <sys/atomic.h>
#include <sys/condvar.h>
@@ -245,9 +245,9 @@ dma_fence_context_alloc(unsigned n)
} S;
uint64_t c;
- while (__predict_false(atomic_cas_uint(&S.lock, 0, 1) != 0))
+ while (__predict_false(atomic_swap_uint(&S.lock, 1)))
SPINLOCK_BACKOFF_HOOK;
- membar_enter();
+ membar_acquire();
c = S.context;
S.context += n;
atomic_store_release(&S.lock, 0);
diff --git a/sys/external/bsd/drm2/linux/linux_dma_fence_chain.c b/sys/external/bsd/drm2/linux/linux_dma_fence_chain.c
index 2e1ae92efb9..8b5f6d5e434 100644
--- a/sys/external/bsd/drm2/linux/linux_dma_fence_chain.c
+++ b/sys/external/bsd/drm2/linux/linux_dma_fence_chain.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_dma_fence_chain.c,v 1.3 2021/12/19 12:39:32 riastradh Exp $ */
+/* $NetBSD: linux_dma_fence_chain.c,v 1.4 2022/04/09 23:44:44 riastradh Exp $ */
/*-
* Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_dma_fence_chain.c,v 1.3 2021/12/19 12:39:32 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_dma_fence_chain.c,v 1.4 2022/04/09 23:44:44 riastradh Exp $");
#include <sys/types.h>
@@ -262,7 +262,7 @@ dma_fence_chain_walk(struct dma_fence *fence)
break;
splice = NULL;
}
- membar_exit(); /* pairs with dma_fence_get_rcu_safe */
+ membar_release(); /* pairs with dma_fence_get_rcu_safe */
if (atomic_cas_ptr(&chain->dfc_prev, prev, splice) == prev)
dma_fence_put(prev); /* transferred to splice */
else