Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/nvmm nvmm: use relaxed atomics to read nmachines



details:   https://anonhg.NetBSD.org/src/rev/161a41b8565e
branches:  trunk
changeset: 937430:161a41b8565e
user:      maxv <maxv%NetBSD.org@localhost>
date:      Tue Aug 18 17:04:37 2020 +0000

description:
nvmm: use relaxed atomics to read nmachines

diffstat:

 sys/dev/nvmm/nvmm.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 1cf349d5f80a -r 161a41b8565e sys/dev/nvmm/nvmm.c
--- a/sys/dev/nvmm/nvmm.c       Tue Aug 18 17:03:58 2020 +0000
+++ b/sys/dev/nvmm/nvmm.c       Tue Aug 18 17:04:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nvmm.c,v 1.34 2020/08/18 17:03:58 maxv Exp $   */
+/*     $NetBSD: nvmm.c,v 1.35 2020/08/18 17:04:37 maxv Exp $   */
 
 /*
  * Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nvmm.c,v 1.34 2020/08/18 17:03:58 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm.c,v 1.35 2020/08/18 17:04:37 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1218,7 +1218,7 @@
 static int
 nvmm_detach(device_t self, int flags)
 {
-       if (nmachines > 0)
+       if (atomic_load_relaxed(&nmachines) > 0)
                return EBUSY;
        nvmm_fini();
        return 0;



Home | Main Index | Thread Index | Old Index