Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/scsipi take the kernel lock during detach of atapibu...



details:   https://anonhg.NetBSD.org/src/rev/a97f1c6801b6
branches:  trunk
changeset: 778612:a97f1c6801b6
user:      chs <chs%NetBSD.org@localhost>
date:      Fri Apr 06 17:12:45 2012 +0000

description:
take the kernel lock during detach of atapibus as well.

diffstat:

 sys/dev/scsipi/atapiconf.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r e5298543870f -r a97f1c6801b6 sys/dev/scsipi/atapiconf.c
--- a/sys/dev/scsipi/atapiconf.c        Fri Apr 06 13:13:13 2012 +0000
+++ b/sys/dev/scsipi/atapiconf.c        Fri Apr 06 17:12:45 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atapiconf.c,v 1.83 2010/06/07 01:41:39 pgoyette Exp $  */
+/*     $NetBSD: atapiconf.c,v 1.84 2012/04/06 17:12:45 chs Exp $       */
 
 /*
  * Copyright (c) 1996, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: atapiconf.c,v 1.83 2010/06/07 01:41:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atapiconf.c,v 1.84 2012/04/06 17:12:45 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -171,6 +171,9 @@
        struct scsipi_periph *periph;
        int target;
 
+       /* XXXSMP scsipi */
+       KERNEL_LOCK(1, curlwp);
+
        for (target = 0; target < chan->chan_ntargets; target++) {
                periph = scsipi_lookup_periph(chan, target, 0);
                if (periph == NULL || periph->periph_dev != child)
@@ -179,6 +182,9 @@
                free(periph, M_DEVBUF);
                break;
        }
+
+       /* XXXSMP scsipi */
+       KERNEL_UNLOCK_ONE(curlwp);
 }
 
 static int



Home | Main Index | Thread Index | Old Index