Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/riastradh-drm2]: src/sys/external/bsd/drm2/linux Pass the wq to linux_wo...



details:   https://anonhg.NetBSD.org/src/rev/d22cdac75c13
branches:  riastradh-drm2
changeset: 788575:d22cdac75c13
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Dec 30 04:50:48 2013 +0000

description:
Pass the wq to linux_worker as it expects, not NULL.

diffstat:

 sys/external/bsd/drm2/linux/linux_work.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (45 lines):

diff -r da84517d762f -r d22cdac75c13 sys/external/bsd/drm2/linux/linux_work.c
--- a/sys/external/bsd/drm2/linux/linux_work.c  Mon Dec 30 04:50:39 2013 +0000
+++ b/sys/external/bsd/drm2/linux/linux_work.c  Mon Dec 30 04:50:48 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_work.c,v 1.1.2.4 2013/12/30 04:50:39 riastradh Exp $     */
+/*     $NetBSD: linux_work.c,v 1.1.2.5 2013/12/30 04:50:48 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_work.c,v 1.1.2.4 2013/12/30 04:50:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_work.c,v 1.1.2.5 2013/12/30 04:50:48 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -116,7 +116,7 @@
 
        wq = kmem_alloc(sizeof(*wq), KM_SLEEP);
        error = workqueue_create(&wq->wq_workqueue, name, &linux_worker,
-           NULL, PRI_NONE, IPL_NONE, flags);
+           wq, PRI_NONE, IPL_NONE, flags);
        if (error) {
                kmem_free(wq, sizeof(*wq));
                return NULL;
@@ -440,6 +440,8 @@
                break;
 
        case WORK_PENDING:
+               KASSERT(work->w_wq == wq);
+
                /* Get ready to invoke this one.  */
                mutex_enter(&wq->wq_lock);
                work->w_state = WORK_INVOKED;
@@ -464,6 +466,8 @@
                break;
 
        case WORK_CANCELLED:
+               KASSERT(work->w_wq == wq);
+
                /* Return to idle; notify anyone waiting for cancellation.  */
                mutex_enter(&wq->wq_lock);
                work->w_state = WORK_IDLE;



Home | Main Index | Thread Index | Old Index