Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/scsipi PR/49054: Uwe Toenjes: Some RAID controllers ...



details:   https://anonhg.NetBSD.org/src/rev/9e05f8394096
branches:  trunk
changeset: 332733:9e05f8394096
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Oct 06 14:42:08 2014 +0000

description:
PR/49054: Uwe Toenjes: Some RAID controllers return more bytes in the
scsi 3 inquiry command than expected by the size of the scsi 3 inquiry
packet. This can be detected by looking at the additional_length field
returned by the scsi 2 inquiry. If that's the case, avoid doing the
scsi 3 inquiry because we can't handle the extra bytes later.
XXX: Pullup -7

diffstat:

 sys/dev/scsipi/scsipi_base.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (47 lines):

diff -r bf256fa3fac8 -r 9e05f8394096 sys/dev/scsipi/scsipi_base.c
--- a/sys/dev/scsipi/scsipi_base.c      Mon Oct 06 14:26:44 2014 +0000
+++ b/sys/dev/scsipi/scsipi_base.c      Mon Oct 06 14:42:08 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsipi_base.c,v 1.160 2014/07/13 17:12:23 dholland Exp $       */
+/*     $NetBSD: scsipi_base.c,v 1.161 2014/10/06 14:42:08 christos Exp $       */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.160 2014/07/13 17:12:23 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.161 2014/10/06 14:42:08 christos Exp $");
 
 #include "opt_scsi.h"
 
@@ -1064,7 +1064,7 @@
 
        /*
         * If we request more data than the device can provide, it SHOULD just
-        * return a short reponse.  However, some devices error with an
+        * return a short response.  However, some devices error with an
         * ILLEGAL REQUEST sense code, and yet others have even more special
         * failture modes (such as the GL641USB flash adapter, which goes loony
         * and sends corrupted CRCs).  To work around this, and to bring our
@@ -1081,6 +1081,7 @@
            10000, NULL, flags | XS_CTL_DATA_IN);
        if (!error &&
            inqbuf->additional_length > SCSIPI_INQUIRY_LENGTH_SCSI2 - 4) {
+           if (inqbuf->additional_length <= SCSIPI_INQUIRY_LENGTH_SCSI3 - 4) {
 #if 0
 printf("inquire: addlen=%d, retrying\n", inqbuf->additional_length);
 #endif
@@ -1091,6 +1092,11 @@
 #if 0
 printf("inquire: error=%d\n", error);
 #endif
+#if 1
+           } else {
+printf("inquire: addlen=%d, not retrying\n", inqbuf->additional_length);
+#endif
+           }
        }
 
 #ifdef SCSI_OLD_NOINQUIRY



Home | Main Index | Thread Index | Old Index