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/i915drm Tweak i915drmkms_detach to be ...



details:   https://anonhg.NetBSD.org/src/rev/6910247e2060
branches:  trunk
changeset: 330884:6910247e2060
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu Jul 24 22:13:23 2014 +0000

description:
Tweak i915drmkms_detach to be more robust.

diffstat:

 sys/external/bsd/drm2/i915drm/i915_pci.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r e15fef9ec9ca -r 6910247e2060 sys/external/bsd/drm2/i915drm/i915_pci.c
--- a/sys/external/bsd/drm2/i915drm/i915_pci.c  Thu Jul 24 22:00:02 2014 +0000
+++ b/sys/external/bsd/drm2/i915drm/i915_pci.c  Thu Jul 24 22:13:23 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_pci.c,v 1.14 2014/07/24 21:18:40 riastradh Exp $  */
+/*     $NetBSD: i915_pci.c,v 1.15 2014/07/24 22:13:23 riastradh Exp $  */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_pci.c,v 1.14 2014/07/24 21:18:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_pci.c,v 1.15 2014/07/24 22:13:23 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/queue.h>
@@ -195,16 +195,19 @@
        if (error)
                return error;
 
-       KASSERT(sc->sc_task_state == I915DRMKMS_TASK_WORKQUEUE);
-       if (sc->sc_task_u.workqueue == NULL)
+       if (sc->sc_task_state == I915DRMKMS_TASK_ATTACH)
                goto out;
-       workqueue_destroy(sc->sc_task_u.workqueue);
+       if (sc->sc_task_u.workqueue != NULL) {
+               workqueue_destroy(sc->sc_task_u.workqueue);
+               sc->sc_task_u.workqueue = NULL;
+       }
 
        if (sc->sc_drm_dev == NULL)
                goto out;
        /* XXX errno Linux->NetBSD */
        error = -drm_pci_detach(sc->sc_drm_dev, flags);
        if (error)
+               /* XXX Kinda too late to fail now...  */
                return error;
        sc->sc_drm_dev = NULL;
 



Home | Main Index | Thread Index | Old Index