Module Name: src Committed By: riastradh Date: Thu Feb 17 01:38:38 UTC 2022
Modified Files: src/sys/external/bsd/drm2/linux: linux_dma_buf.c Log Message: drm: Fix membars around dma_buf_put reference count release. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/external/bsd/drm2/linux/linux_dma_buf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/external/bsd/drm2/linux/linux_dma_buf.c diff -u src/sys/external/bsd/drm2/linux/linux_dma_buf.c:1.13 src/sys/external/bsd/drm2/linux/linux_dma_buf.c:1.14 --- src/sys/external/bsd/drm2/linux/linux_dma_buf.c:1.13 Sun Dec 19 12:01:40 2021 +++ src/sys/external/bsd/drm2/linux/linux_dma_buf.c Thu Feb 17 01:38:38 2022 @@ -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 @@ void 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);