Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ieee1394 do not hold mutexes when calling tsleep(9).



details:   https://anonhg.NetBSD.org/src/rev/8f883247ddef
branches:  trunk
changeset: 757137:8f883247ddef
user:      cegger <cegger%NetBSD.org@localhost>
date:      Mon Aug 16 06:05:07 2010 +0000

description:
do not hold mutexes when calling tsleep(9).
Fixes LOCKDEBUG panics

diffstat:

 sys/dev/ieee1394/fwdev.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r a0ea24043fd8 -r 8f883247ddef sys/dev/ieee1394/fwdev.c
--- a/sys/dev/ieee1394/fwdev.c  Mon Aug 16 04:31:21 2010 +0000
+++ b/sys/dev/ieee1394/fwdev.c  Mon Aug 16 06:05:07 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fwdev.c,v 1.22 2010/05/23 18:56:58 christos Exp $      */
+/*     $NetBSD: fwdev.c,v 1.23 2010/08/16 06:05:07 cegger Exp $        */
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fwdev.c,v 1.22 2010/05/23 18:56:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwdev.c,v 1.23 2010/08/16 06:05:07 cegger Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -248,7 +248,9 @@
                if (slept == 0) {
                        slept = 1;
                        ir->flag |= FWXFERQ_WAKEUP;
+                       mutex_exit(&fc->fc_mtx);
                        err = tsleep(ir, FWPRI, "fw_read", hz);
+                       mutex_enter(&fc->fc_mtx);
                        ir->flag &= ~FWXFERQ_WAKEUP;
                        if (err == 0)
                                goto readloop;
@@ -324,7 +326,9 @@
                        if (err)
                                goto out;
 #endif
+                       mutex_exit(&fc->fc_mtx);
                        err = tsleep(it, FWPRI, "fw_write", hz);
+                       mutex_enter(&fc->fc_mtx);
                        if (err)
                                goto out;
                        goto isoloop;



Home | Main Index | Thread Index | Old Index