Module Name: src
Committed By: riz
Date: Tue May 22 18:46:10 UTC 2012
Modified Files:
src/sys/dev/scsipi [netbsd-6]: scsiconf.c
Log Message:
Pull up following revision(s) (requested by jakllsch in ticket #277):
sys/dev/scsipi/scsiconf.c: revision 1.268
Fix locking issue triggered by drvctr -r of a scsibus(4).
Pullup to netbsd-6 should be requested.
To generate a diff of this commit:
cvs rdiff -u -r1.262.10.2 -r1.262.10.3 src/sys/dev/scsipi/scsiconf.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/scsipi/scsiconf.c
diff -u src/sys/dev/scsipi/scsiconf.c:1.262.10.2 src/sys/dev/scsipi/scsiconf.c:1.262.10.3
--- src/sys/dev/scsipi/scsiconf.c:1.262.10.2 Mon Apr 23 16:28:30 2012
+++ src/sys/dev/scsipi/scsiconf.c Tue May 22 18:46:09 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: scsiconf.c,v 1.262.10.2 2012/04/23 16:28:30 riz Exp $ */
+/* $NetBSD: scsiconf.c,v 1.262.10.3 2012/05/22 18:46:09 riz Exp $ */
/*-
* Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.262.10.2 2012/04/23 16:28:30 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.262.10.3 2012/05/22 18:46:09 riz Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -340,6 +340,9 @@ scsi_probe_bus(struct scsibus_softc *sc,
int maxtarget, mintarget, maxlun, minlun;
int error;
+ /* XXXSMP scsipi */
+ KERNEL_LOCK(1, curlwp);
+
if (target == -1) {
maxtarget = chan->chan_ntargets - 1;
mintarget = 0;
@@ -367,7 +370,7 @@ scsi_probe_bus(struct scsibus_softc *sc,
0, curproc);
if ((error = scsipi_adapter_addref(chan->chan_adapter)) != 0)
- return (error);
+ goto ret;
for (target = mintarget; target <= maxtarget; target++) {
if (target == chan->chan_id)
continue;
@@ -388,7 +391,9 @@ scsi_probe_bus(struct scsibus_softc *sc,
scsipi_set_xfer_mode(chan, target, 1);
}
scsipi_adapter_delref(chan->chan_adapter);
- return (0);
+ret:
+ KERNEL_UNLOCK_ONE(curlwp);
+ return (error);
}
static int