Module Name:    src
Committed By:   mrg
Date:           Tue Aug 28 20:59:21 UTC 2018

Modified Files:
        src/sys/external/bsd/drm2/dist/drm/nouveau: nouveau_fence.c

Log Message:
move spin_lock_destroy() of the nouveau_fence_chan into
nouveau_fence_context_put() so it's available until all uses are done.
fixes a panic at reboot time.  idea from riastradh@.

(nv still has a off screen.)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
    src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.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/dist/drm/nouveau/nouveau_fence.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c:1.12 src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c:1.13
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c:1.12	Mon Aug 27 07:37:07 2018
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c	Tue Aug 28 20:59:21 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_fence.c,v 1.12 2018/08/27 07:37:07 riastradh Exp $	*/
+/*	$NetBSD: nouveau_fence.c,v 1.13 2018/08/28 20:59:21 mrg Exp $	*/
 
 /*
  * Copyright (C) 2007 Ben Skeggs.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_fence.c,v 1.12 2018/08/27 07:37:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_fence.c,v 1.13 2018/08/28 20:59:21 mrg Exp $");
 
 #include <drm/drmP.h>
 
@@ -106,7 +106,6 @@ nouveau_fence_context_del(struct nouveau
 			nvif_notify_put(&fctx->notify);
 	}
 	spin_unlock_irq(&fctx->lock);
-	spin_lock_destroy(&fctx->lock);
 
 	nvif_notify_fini(&fctx->notify);
 	fctx->dead = 1;
@@ -121,7 +120,11 @@ nouveau_fence_context_del(struct nouveau
 static void
 nouveau_fence_context_put(struct kref *fence_ref)
 {
-	kfree(container_of(fence_ref, struct nouveau_fence_chan, fence_ref));
+	struct nouveau_fence_chan *fctx =
+	    container_of(fence_ref, struct nouveau_fence_chan, fence_ref);
+
+	spin_lock_destroy(&fctx->lock);
+	kfree(fctx);
 }
 
 void

Reply via email to