Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/mps/mps_sas_lsi.c
Show First 20 Lines • Show All 788 Lines • ▼ Show 20 Lines | mpssas_get_sas_address_for_sata_disk(struct mps_softc *sc, | ||||
try_count = 0; | try_count = 0; | ||||
do { | do { | ||||
rc = mpssas_get_sata_identify(sc, handle, &mpi_reply, | rc = mpssas_get_sata_identify(sc, handle, &mpi_reply, | ||||
(char *)&ata_identify, sizeof(ata_identify), device_info); | (char *)&ata_identify, sizeof(ata_identify), device_info); | ||||
try_count++; | try_count++; | ||||
ioc_status = le16toh(mpi_reply.IOCStatus) | ioc_status = le16toh(mpi_reply.IOCStatus) | ||||
& MPI2_IOCSTATUS_MASK; | & MPI2_IOCSTATUS_MASK; | ||||
sas_status = mpi_reply.SASStatus; | 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) { | if (sc->spinup_wait_time > 0) { | ||||
mps_dprint(sc, MPS_INFO, "Sleeping %d seconds " | mps_dprint(sc, MPS_INFO, "Sleeping %d seconds " | ||||
"after SATA ID error to wait for spinup\n", | "after SATA ID error to wait for spinup\n", | ||||
sc->spinup_wait_time); | sc->spinup_wait_time); | ||||
msleep(&sc->msleep_fake_chan, &sc->mps_mtx, 0, | msleep(&sc->msleep_fake_chan, &sc->mps_mtx, 0, | ||||
"mpsid", sc->spinup_wait_time * hz); | "mpsid", sc->spinup_wait_time * hz); | ||||
} | } | ||||
} | } | ||||
} while (((rc && (rc != EWOULDBLOCK)) || ioc_status || sas_status) && | } while (((rc && (rc != EWOULDBLOCK)) || | ||||
(try_count < 5)); | (ioc_status && | ||||
(ioc_status != MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR)) | |||||
|| sas_status) && (try_count < 5)); | |||||
if (rc == 0 && !ioc_status && !sas_status) { | if (rc == 0 && !ioc_status && !sas_status) { | ||||
mps_dprint(sc, MPS_MAPPING, "%s: got SATA identify " | mps_dprint(sc, MPS_MAPPING, "%s: got SATA identify " | ||||
"successfully for handle = 0x%x with try_count = %d\n", | "successfully for handle = 0x%x with try_count = %d\n", | ||||
__func__, handle, try_count); | __func__, handle, try_count); | ||||
} else { | } else { | ||||
mps_dprint(sc, MPS_MAPPING, "%s: handle = 0x%x failed\n", | mps_dprint(sc, MPS_MAPPING, "%s: handle = 0x%x failed\n", | ||||
__func__, handle); | __func__, handle); | ||||
▲ Show 20 Lines • Show All 475 Lines • Show Last 20 Lines |