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/nouveau move spin_lock_destro...



details:   https://anonhg.NetBSD.org/src/rev/6d2629175101
branches:  trunk
changeset: 366480:6d2629175101
user:      mrg <mrg%NetBSD.org@localhost>
date:      Tue Aug 28 20:59:21 2018 +0000

description:
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.)

diffstat:

 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r 978e8314e622 -r 6d2629175101 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c    Tue Aug 28 20:11:58 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c    Tue Aug 28 20:59:21 2018 +0000
@@ -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 @@
                        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 @@
 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



Home | Main Index | Thread Index | Old Index