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/drm Lock the manager and not just the ...



details:   https://anonhg.NetBSD.org/src/rev/86124fc8cc1f
branches:  trunk
changeset: 348996:86124fc8cc1f
user:      maya <maya%NetBSD.org@localhost>
date:      Sat Nov 19 17:19:59 2016 +0000

description:
Lock the manager and not just the node for inserting/removing nodes

should fix/help PR kern/50349: radeondrmkms vt-switching crash

ok riastradh

diffstat:

 sys/external/bsd/drm2/drm/drm_vma_manager.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (43 lines):

diff -r eb070e682333 -r 86124fc8cc1f sys/external/bsd/drm2/drm/drm_vma_manager.c
--- a/sys/external/bsd/drm2/drm/drm_vma_manager.c       Sat Nov 19 15:13:46 2016 +0000
+++ b/sys/external/bsd/drm2/drm/drm_vma_manager.c       Sat Nov 19 17:19:59 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_vma_manager.c,v 1.4 2016/04/19 02:52:29 riastradh Exp $    */
+/*     $NetBSD: drm_vma_manager.c,v 1.5 2016/11/19 17:19:59 maya Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_vma_manager.c,v 1.4 2016/04/19 02:52:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_vma_manager.c,v 1.5 2016/11/19 17:19:59 maya Exp $");
 
 #include <sys/kmem.h>
 #include <sys/rbtree.h>
@@ -180,10 +180,10 @@
        node->von_startpage = startpage;
        node->von_npages = npages;
 
-       rw_enter(&node->von_lock, RW_WRITER);
+       rw_enter(&mgr->vom_lock, RW_WRITER);
        collision = rb_tree_insert_node(&mgr->vom_nodes, node);
        KASSERT(collision == node);
-       rw_exit(&node->von_lock);
+       rw_exit(&mgr->vom_lock);
 
        return 0;
 }
@@ -196,9 +196,9 @@
        if (node->von_npages == 0)
                return;
 
-       rw_enter(&node->von_lock, RW_WRITER);
+       rw_enter(&mgr->vom_lock, RW_WRITER);
        rb_tree_remove_node(&mgr->vom_nodes, node);
-       rw_exit(&node->von_lock);
+       rw_exit(&mgr->vom_lock);
 
        vmem_free(mgr->vom_vmem, node->von_startpage, node->von_npages);
 



Home | Main Index | Thread Index | Old Index