Module Name: src
Committed By: jdc
Date: Sat May 2 06:45:53 UTC 2020
Modified Files:
src/sys/dev/scsipi: scsiconf.c
Log Message:
Don't attempt to read opcodes and their timeouts at attach time for
old devices. The MAINTENANCE IN command was introduced with SCSI-3
and sending it to older peripherals can cause timeouts or them not
to respond to further requests.
To generate a diff of this commit:
cvs rdiff -u -r1.286 -r1.287 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.286 src/sys/dev/scsipi/scsiconf.c:1.287
--- src/sys/dev/scsipi/scsiconf.c:1.286 Wed Feb 19 16:04:39 2020
+++ src/sys/dev/scsipi/scsiconf.c Sat May 2 06:45:53 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: scsiconf.c,v 1.286 2020/02/19 16:04:39 riastradh Exp $ */
+/* $NetBSD: scsiconf.c,v 1.287 2020/05/02 06:45:53 jdc 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.286 2020/02/19 16:04:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.287 2020/05/02 06:45:53 jdc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1018,10 +1018,14 @@ scsi_probe_device(struct scsibus_softc *
scsipi_insert_periph(chan, periph);
/*
- * determine supported opcodes and
- * timeouts if available
+ * Determine supported opcodes and timeouts if available.
+ * Only do this on peripherals reporting SCSI version 3
+ * or greater - this command isn't in the SCSI-2 spec. and
+ * it causes either timeouts or peripherals disappearing
+ * when sent to some SCSI-1 or SCSI-2 peripherals.
*/
- scsipi_get_opcodeinfo(periph);
+ if (periph->periph_version >= 3)
+ scsipi_get_opcodeinfo(periph);
/*
* XXX Can't assign periph_dev here, because we'll