Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic take the kernel lock in functions called from att...



details:   https://anonhg.NetBSD.org/src/rev/5a40d834adab
branches:  trunk
changeset: 777945:5a40d834adab
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sat Mar 10 20:54:20 2012 +0000

description:
take the kernel lock in functions called from attach*().

diffstat:

 sys/dev/ic/ncr53c9x.c    |  10 ++++++++--
 sys/dev/ic/ninjascsi32.c |   8 ++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diffs (70 lines):

diff -r 2fd25f548719 -r 5a40d834adab sys/dev/ic/ncr53c9x.c
--- a/sys/dev/ic/ncr53c9x.c     Sat Mar 10 20:52:30 2012 +0000
+++ b/sys/dev/ic/ncr53c9x.c     Sat Mar 10 20:54:20 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ncr53c9x.c,v 1.143 2011/07/31 18:39:00 jakllsch Exp $  */
+/*     $NetBSD: ncr53c9x.c,v 1.144 2012/03/10 20:54:20 mrg Exp $       */
 
 /*-
  * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ncr53c9x.c,v 1.143 2011/07/31 18:39:00 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ncr53c9x.c,v 1.144 2012/03/10 20:54:20 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -530,6 +530,9 @@
        sc->sc_msgpriq = sc->sc_msgout = sc->sc_msgoutq = 0;
        sc->sc_phase = sc->sc_prevphase = INVALID_PHASE;
 
+       /* XXXSMP scsipi */
+       KERNEL_LOCK(1, curlwp);
+
        for (r = 0; r < sc->sc_ntarg; r++) {
                struct ncr53c9x_tinfo *ti = &sc->sc_tinfo[r];
 /* XXX - config flags per target: low bits: no reselect; high bits: no synch */
@@ -559,6 +562,9 @@
 
        /* Notify upper layer */
        scsipi_async_event(&sc->sc_channel, ASYNC_EVENT_RESET, NULL);
+
+       /* XXXSMP scsipi */
+       KERNEL_UNLOCK_ONE(curlwp);
 }
 
 /*
diff -r 2fd25f548719 -r 5a40d834adab sys/dev/ic/ninjascsi32.c
--- a/sys/dev/ic/ninjascsi32.c  Sat Mar 10 20:52:30 2012 +0000
+++ b/sys/dev/ic/ninjascsi32.c  Sat Mar 10 20:54:20 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ninjascsi32.c,v 1.21 2010/11/13 13:52:01 uebayasi Exp $        */
+/*     $NetBSD: ninjascsi32.c,v 1.22 2012/03/10 20:54:21 mrg Exp $     */
 
 /*-
  * Copyright (c) 2004, 2006, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ninjascsi32.c,v 1.21 2010/11/13 13:52:01 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ninjascsi32.c,v 1.22 2012/03/10 20:54:21 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1399,9 +1399,13 @@
        /* initialize target structure */
        njsc32_init_targets(sc);
 
+       /* XXXSMP scsipi */
+       KERNEL_LOCK(1, curlwp);
        s = splbio();
        scsipi_async_event(&sc->sc_channel, ASYNC_EVENT_RESET, NULL);
        splx(s);
+       /* XXXSMP scsipi */
+       KERNEL_UNLOCK_ONE(curlwp);
 
        /* release SCSI bus reset */
        njsc32_write_1(sc, NJSC32_REG_SCSI_BUS_CONTROL, 0);



Home | Main Index | Thread Index | Old Index