Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/linux drm: Fix membars around dma_buf_...



details:   https://anonhg.NetBSD.org/src/rev/b2576afa9f4f
branches:  trunk
changeset: 361601:b2576afa9f4f
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu Feb 17 01:38:38 2022 +0000

description:
drm: Fix membars around dma_buf_put reference count release.

diffstat:

 sys/external/bsd/drm2/linux/linux_dma_buf.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r e63c17d95d9d -r b2576afa9f4f sys/external/bsd/drm2/linux/linux_dma_buf.c
--- a/sys/external/bsd/drm2/linux/linux_dma_buf.c       Thu Feb 17 01:21:02 2022 +0000
+++ b/sys/external/bsd/drm2/linux/linux_dma_buf.c       Thu Feb 17 01:38:38 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_dma_buf.c,v 1.13 2021/12/19 12:01:40 riastradh Exp $     */
+/*     $NetBSD: linux_dma_buf.c,v 1.14 2022/02/17 01:38:38 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.13 2021/12/19 12:01:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_dma_buf.c,v 1.14 2022/02/17 01:38:38 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/atomic.h>
@@ -160,8 +160,10 @@
 dma_buf_put(struct dma_buf *dmabuf)
 {
 
+       membar_exit();
        if (atomic_dec_uint_nv(&dmabuf->db_refcnt) != 0)
                return;
+       membar_enter();
 
        dma_resv_poll_fini(&dmabuf->db_resv_poll);
        mutex_destroy(&dmabuf->db_lock);



Home | Main Index | Thread Index | Old Index