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/dist/drm/radeon Fix fence API usage: l...



details:   https://anonhg.NetBSD.org/src/rev/96831ddc0cff
branches:  trunk
changeset: 364619:96831ddc0cff
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 13:34:50 2018 +0000

description:
Fix fence API usage: lock is _not_ held here, so acquire it.

diffstat:

 sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r ca21fa905997 -r 96831ddc0cff sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c      Mon Aug 27 13:33:59 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c      Mon Aug 27 13:34:50 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radeon_fence.c,v 1.12 2018/08/27 07:49:25 riastradh Exp $      */
+/*     $NetBSD: radeon_fence.c,v 1.13 2018/08/27 13:34:50 riastradh Exp $      */
 
 /*
  * Copyright 2009 Jerome Glisse.
@@ -31,7 +31,7 @@
  *    Dave Airlie
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeon_fence.c,v 1.12 2018/08/27 07:49:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_fence.c,v 1.13 2018/08/27 13:34:50 riastradh Exp $");
 
 #include <linux/seq_file.h>
 #include <linux/atomic.h>
@@ -1165,7 +1165,7 @@
        struct radeon_device *rdev = fence->rdev;
        int r;
 
-       BUG_ON(!spin_is_locked(&rdev->fence_lock));
+       spin_lock(&rdev->fence_lock);
        if (intr) {
                DRM_SPIN_TIMED_WAIT_UNTIL(r, &rdev->fence_queue,
                    &rdev->fence_lock, timo,
@@ -1175,6 +1175,7 @@
                    &rdev->fence_lock, timo,
                    radeon_test_signaled(fence));
        }
+       spin_unlock(&rdev->fence_lock);
 
        return r;
 }



Home | Main Index | Thread Index | Old Index