Module Name:    src
Committed By:   mrg
Date:           Sat Mar 10 20:54:21 UTC 2012

Modified Files:
        src/sys/dev/ic: ncr53c9x.c ninjascsi32.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/sys/dev/ic/ncr53c9x.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/ic/ninjascsi32.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/ncr53c9x.c
diff -u src/sys/dev/ic/ncr53c9x.c:1.143 src/sys/dev/ic/ncr53c9x.c:1.144
--- src/sys/dev/ic/ncr53c9x.c:1.143	Sun Jul 31 18:39:00 2011
+++ src/sys/dev/ic/ncr53c9x.c	Sat Mar 10 20:54:20 2012
@@ -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 @@ ncr53c9x_init(struct ncr53c9x_softc *sc,
 	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 @@ ncr53c9x_init(struct ncr53c9x_softc *sc,
 
 	/* Notify upper layer */
 	scsipi_async_event(&sc->sc_channel, ASYNC_EVENT_RESET, NULL);
+
+	/* XXXSMP scsipi */
+	KERNEL_UNLOCK_ONE(curlwp);
 }
 
 /*

Index: src/sys/dev/ic/ninjascsi32.c
diff -u src/sys/dev/ic/ninjascsi32.c:1.21 src/sys/dev/ic/ninjascsi32.c:1.22
--- src/sys/dev/ic/ninjascsi32.c:1.21	Sat Nov 13 13:52:01 2010
+++ src/sys/dev/ic/ninjascsi32.c	Sat Mar 10 20:54:21 2012
@@ -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 @@ njsc32_reset_bus(struct njsc32_softc *sc
 	/* 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);

Reply via email to