aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mps
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/mps')
-rw-r--r--sys/dev/mps/mps.c38
-rw-r--r--sys/dev/mps/mps_pci.c4
-rw-r--r--sys/dev/mps/mps_sas.c3
-rw-r--r--sys/dev/mps/mps_sas_lsi.c3
4 files changed, 34 insertions, 14 deletions
diff --git a/sys/dev/mps/mps.c b/sys/dev/mps/mps.c
index adad2450a3d4..9dfa0471ac0a 100644
--- a/sys/dev/mps/mps.c
+++ b/sys/dev/mps/mps.c
@@ -1127,7 +1127,7 @@ mps_get_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
{
MPI2_DEFAULT_REPLY *reply;
MPI2_IOC_FACTS_REQUEST request;
- int error, req_sz, reply_sz;
+ int error, req_sz, reply_sz, retry = 0;
MPS_FUNCTRACE(sc);
mps_dprint(sc, MPS_INIT, "%s entered\n", __func__);
@@ -1136,10 +1136,21 @@ mps_get_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
reply_sz = sizeof(MPI2_IOC_FACTS_REPLY);
reply = (MPI2_DEFAULT_REPLY *)facts;
+ /*
+ * Retry sending the initialization sequence. Sometimes, especially with
+ * older firmware, the initialization process fails. Retrying allows the
+ * error to clear in the firmware.
+ */
bzero(&request, req_sz);
request.Function = MPI2_FUNCTION_IOC_FACTS;
- error = mps_request_sync(sc, &request, reply, req_sz, reply_sz, 5);
- mps_dprint(sc, MPS_INIT, "%s exit error= %d\n", __func__, error);
+ while (retry < 5) {
+ error = mps_request_sync(sc, &request, reply, req_sz, reply_sz, 5);
+ if (error == 0)
+ break;
+ mps_dprint(sc, MPS_FAULT, "%s failed retry %d\n", __func__, retry);
+ DELAY(1000);
+ retry++;
+ }
return (error);
}
@@ -1149,7 +1160,7 @@ mps_send_iocinit(struct mps_softc *sc)
{
MPI2_IOC_INIT_REQUEST init;
MPI2_DEFAULT_REPLY reply;
- int req_sz, reply_sz, error;
+ int req_sz, reply_sz, error, retry = 0;
struct timeval now;
uint64_t time_in_msec;
@@ -1193,10 +1204,21 @@ mps_send_iocinit(struct mps_softc *sc)
time_in_msec = (now.tv_sec * 1000 + now.tv_usec/1000);
init.TimeStamp.High = htole32((time_in_msec >> 32) & 0xFFFFFFFF);
init.TimeStamp.Low = htole32(time_in_msec & 0xFFFFFFFF);
-
- error = mps_request_sync(sc, &init, &reply, req_sz, reply_sz, 5);
- if ((reply.IOCStatus & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS)
- error = ENXIO;
+ /*
+ * Retry sending the initialization sequence. Sometimes, especially with
+ * older firmware, the initialization process fails. Retrying allows the
+ * error to clear in the firmware.
+ */
+ while (retry < 5) {
+ error = mps_request_sync(sc, &init, &reply, req_sz, reply_sz, 5);
+ if ((reply.IOCStatus & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS)
+ error = ENXIO;
+ if (error == 0)
+ break;
+ mps_dprint(sc, MPS_FAULT, "%s failed retry %d\n", __func__, retry);
+ DELAY(1000);
+ retry++;
+ }
mps_dprint(sc, MPS_INIT, "IOCInit status= 0x%x\n", reply.IOCStatus);
mps_dprint(sc, MPS_INIT, "%s exit\n", __func__);
diff --git a/sys/dev/mps/mps_pci.c b/sys/dev/mps/mps_pci.c
index ece49435b39e..7a0c577eb72a 100644
--- a/sys/dev/mps/mps_pci.c
+++ b/sys/dev/mps/mps_pci.c
@@ -122,8 +122,8 @@ struct mps_ident {
0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2208" },
{ MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2308_1,
0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2308" },
- // Add Customer specific vender/subdevice id before generic
- // (0xffff) vender/subdevice id.
+ // Add Customer specific vendor/subdevice id before generic
+ // (0xffff) vendor/subdevice id.
{ MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2308_2,
0x8086, 0x3516, 0, "Intel(R) Integrated RAID Module RMS25JB080" },
{ MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2308_2,
diff --git a/sys/dev/mps/mps_sas.c b/sys/dev/mps/mps_sas.c
index 3cf29aa4e893..d69c8ea5fded 100644
--- a/sys/dev/mps/mps_sas.c
+++ b/sys/dev/mps/mps_sas.c
@@ -51,13 +51,12 @@
#include <sys/kthread.h>
#include <sys/taskqueue.h>
#include <sys/sbuf.h>
+#include <sys/stdarg.h>
#include <machine/bus.h>
#include <machine/resource.h>
#include <sys/rman.h>
-#include <machine/stdarg.h>
-
#include <cam/cam.h>
#include <cam/cam_ccb.h>
#include <cam/cam_xpt.h>
diff --git a/sys/dev/mps/mps_sas_lsi.c b/sys/dev/mps/mps_sas_lsi.c
index aeec50433e04..e2d1ef2b013a 100644
--- a/sys/dev/mps/mps_sas_lsi.c
+++ b/sys/dev/mps/mps_sas_lsi.c
@@ -52,13 +52,12 @@
#include <sys/taskqueue.h>
#include <sys/sbuf.h>
#include <sys/reboot.h>
+#include <sys/stdarg.h>
#include <machine/bus.h>
#include <machine/resource.h>
#include <sys/rman.h>
-#include <machine/stdarg.h>
-
#include <cam/cam.h>
#include <cam/cam_ccb.h>
#include <cam/cam_debug.h>