summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorasomers <asomers@FreeBSD.org>2015-12-14 19:40:47 +0000
committerasomers <asomers@FreeBSD.org>2015-12-14 19:40:47 +0000
commit237e91b5a1bbaac1ccd6b091e8b2ae3cc09f128e (patch)
tree63a5a8fb421786283a111c40fc56de59f24cbb4e
parent9eafa99cffe9c35d0c2fca4ae5d7ff5b11d56e59 (diff)
downloadFreeBSD-src-237e91b5a1bbaac1ccd6b091e8b2ae3cc09f128e.zip
FreeBSD-src-237e91b5a1bbaac1ccd6b091e8b2ae3cc09f128e.tar.gz
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. Reviewed by: slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4553
-rw-r--r--sys/dev/mpr/mpr_sas_lsi.c14
-rw-r--r--sys/dev/mps/mps_sas_lsi.c14
2 files changed, 22 insertions, 6 deletions
diff --git a/sys/dev/mpr/mpr_sas_lsi.c b/sys/dev/mpr/mpr_sas_lsi.c
index 7d6ef70..b2ffe96 100644
--- a/sys/dev/mpr/mpr_sas_lsi.c
+++ b/sys/dev/mpr/mpr_sas_lsi.c
@@ -885,7 +885,13 @@ mprsas_get_sas_address_for_sata_disk(struct mpr_softc *sc,
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(struct mpr_softc *sc,
"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 "
diff --git a/sys/dev/mps/mps_sas_lsi.c b/sys/dev/mps/mps_sas_lsi.c
index 434663a..268383a 100644
--- a/sys/dev/mps/mps_sas_lsi.c
+++ b/sys/dev/mps/mps_sas_lsi.c
@@ -794,7 +794,13 @@ mpssas_get_sas_address_for_sata_disk(struct mps_softc *sc,
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(struct mps_softc *sc,
"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 "
OpenPOWER on IntegriCloud