Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jan 2016 21:12:50 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r293701 - in stable/10/sys/dev: mpr mps
Message-ID:  <201601112112.u0BLCorI000144@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: asomers
Date: Mon Jan 11 21:12:49 2016
New Revision: 293701
URL: https://svnweb.freebsd.org/changeset/base/293701

Log:
  MFC r292218
  
  Don't retry SAS commands in response to protocol errors
  
    sys/dev/mpr/mpr_sas_lsi.c
    sys/dev/mps/mps_sas_lsi.c
          When mp[rs]sas_get_sata_identify returns
          MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR, don't bother retrying. Protocol
          errors aren't likely to be fixed by sleeping.
  
          Without this change, a system that generated may protocol errors due
          to signal integrity issues was taking more than an hour to boot, due
          to all the retries.

Modified:
  stable/10/sys/dev/mpr/mpr_sas_lsi.c
  stable/10/sys/dev/mps/mps_sas_lsi.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/mpr/mpr_sas_lsi.c
==============================================================================
--- stable/10/sys/dev/mpr/mpr_sas_lsi.c	Mon Jan 11 21:02:30 2016	(r293700)
+++ stable/10/sys/dev/mpr/mpr_sas_lsi.c	Mon Jan 11 21:12:49 2016	(r293701)
@@ -885,7 +885,13 @@ mprsas_get_sas_address_for_sata_disk(str
 		ioc_status = le16toh(mpi_reply.IOCStatus)
 		    & MPI2_IOCSTATUS_MASK;
 		sas_status = mpi_reply.SASStatus;
-		if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
+		switch (ioc_status) {
+		case MPI2_IOCSTATUS_SUCCESS:
+			break;
+		case MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR:
+			/* No sense sleeping.  this error won't get better */
+			break;
+		default:
 			if (sc->spinup_wait_time > 0) {
 				mpr_dprint(sc, MPR_INFO, "Sleeping %d seconds "
 				    "after SATA ID error to wait for spinup\n",
@@ -894,8 +900,10 @@ mprsas_get_sas_address_for_sata_disk(str
 				    "mprid", sc->spinup_wait_time * hz);
 			}
 		}
-	} while (((rc && (rc != EWOULDBLOCK)) || ioc_status || sas_status) &&
-	    (try_count < 5));
+	} while (((rc && (rc != EWOULDBLOCK)) ||
+	         (ioc_status &&
+		  (ioc_status != MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR))
+	       || sas_status) && (try_count < 5));
 
 	if (rc == 0 && !ioc_status && !sas_status) {
 		mpr_dprint(sc, MPR_MAPPING, "%s: got SATA identify "

Modified: stable/10/sys/dev/mps/mps_sas_lsi.c
==============================================================================
--- stable/10/sys/dev/mps/mps_sas_lsi.c	Mon Jan 11 21:02:30 2016	(r293700)
+++ stable/10/sys/dev/mps/mps_sas_lsi.c	Mon Jan 11 21:12:49 2016	(r293701)
@@ -794,7 +794,13 @@ mpssas_get_sas_address_for_sata_disk(str
 		ioc_status = le16toh(mpi_reply.IOCStatus)
 		    & MPI2_IOCSTATUS_MASK;
 		sas_status = mpi_reply.SASStatus;
-		if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
+		switch (ioc_status) {
+		case MPI2_IOCSTATUS_SUCCESS:
+			break;
+		case MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR:
+			/* No sense sleeping.  this error won't get better */
+			break;
+		default:
 			if (sc->spinup_wait_time > 0) {
 				mps_dprint(sc, MPS_INFO, "Sleeping %d seconds "
 				    "after SATA ID error to wait for spinup\n",
@@ -803,8 +809,10 @@ mpssas_get_sas_address_for_sata_disk(str
 				    "mpsid", sc->spinup_wait_time * hz);
 			}
 		}
-	} while (((rc && (rc != EWOULDBLOCK)) || ioc_status || sas_status) &&
-	    (try_count < 5));
+	} while (((rc && (rc != EWOULDBLOCK)) ||
+	    	 (ioc_status && 
+		  (ioc_status != MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR))
+	       || sas_status) && (try_count < 5));
 
 	if (rc == 0 && !ioc_status && !sas_status) {
 		mps_dprint(sc, MPS_MAPPING, "%s: got SATA identify "



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601112112.u0BLCorI000144>