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 Issue __insn_barrier after loadi...



details:   https://anonhg.NetBSD.org/src/rev/078900d625ce
branches:  trunk
changeset: 993176:078900d625ce
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Aug 28 15:04:02 2018 +0000

description:
Issue __insn_barrier after loading hardclock_ticks.

For some reason this isn't volatile...

diffstat:

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

diffs (50 lines):

diff -r cd13227e349c -r 078900d625ce sys/external/bsd/drm2/linux/linux_fence.c
--- a/sys/external/bsd/drm2/linux/linux_fence.c Tue Aug 28 15:03:39 2018 +0000
+++ b/sys/external/bsd/drm2/linux/linux_fence.c Tue Aug 28 15:04:02 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_fence.c,v 1.11 2018/08/28 15:03:39 riastradh Exp $       */
+/*     $NetBSD: linux_fence.c,v 1.12 2018/08/28 15:04:02 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_fence.c,v 1.11 2018/08/28 15:03:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_fence.c,v 1.12 2018/08/28 15:04:02 riastradh Exp $");
 
 #include <sys/atomic.h>
 #include <sys/condvar.h>
@@ -543,6 +543,7 @@
        mutex_enter(&common.lock);
        while (timeout > 0 && !common.done) {
                start = hardclock_ticks;
+               __insn_barrier();
                if (intr) {
                        if (timeout != MAX_SCHEDULE_TIMEOUT) {
                                ret = -cv_timedwait_sig(&common.cv,
@@ -562,6 +563,7 @@
                        }
                }
                end = hardclock_ticks;
+               __insn_barrier();
                if (ret)
                        break;
                timeout -= MIN(timeout, (unsigned)end - (unsigned)start);
@@ -672,6 +674,7 @@
        /* Find out what our deadline is so we can handle spurious wakeup.  */
        if (timeout < MAX_SCHEDULE_TIMEOUT) {
                now = hardclock_ticks;
+               __insn_barrier();
                starttime = now;
                deadline = starttime + timeout;
        }
@@ -684,6 +687,7 @@
                 */
                if (timeout < MAX_SCHEDULE_TIMEOUT) {
                        now = hardclock_ticks;
+                       __insn_barrier();
                        if (deadline <= now)
                                break;
                }



Home | Main Index | Thread Index | Old Index