Index: sys/dev/mps/mps.c =================================================================== --- sys/dev/mps/mps.c +++ sys/dev/mps/mps.c @@ -689,6 +689,8 @@ return 0; } + mpssas_prepare_reinit(sc); + mps_dprint(sc, MPS_INFO, "Reinitializing controller,\n"); /* make sure the completion callbacks can recognize they're getting * a NULL cm_reply due to a reset. Index: sys/dev/mps/mps_sas.c =================================================================== --- sys/dev/mps/mps_sas.c +++ sys/dev/mps/mps_sas.c @@ -1112,11 +1112,12 @@ } void -mpssas_handle_reinit(struct mps_softc *sc) +mpssas_prepare_reinit(struct mps_softc *sc) { - int i; - - /* Go back into startup mode and freeze the simq, so that CAM + /* + * Prepare for a diag reset and reinitialization. + * + * Go back into startup mode and freeze the simq, so that CAM * doesn't send any commands until after we've rediscovered all * targets and found the proper device handles for them. * @@ -1128,7 +1129,13 @@ sc->sassc->flags |= MPSSAS_IN_STARTUP; sc->sassc->flags |= MPSSAS_IN_DISCOVERY; mpssas_startup_increment(sc->sassc); +} +void +mpssas_handle_reinit(struct mps_softc *sc) +{ + int i; + /* notify CAM of a bus reset */ mpssas_announce_reset(sc, AC_BUS_RESET, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); Index: sys/dev/mps/mpsvar.h =================================================================== --- sys/dev/mps/mpsvar.h +++ sys/dev/mps/mpsvar.h @@ -739,6 +739,7 @@ void mpssas_ir_shutdown(struct mps_softc *sc); int mps_reinit(struct mps_softc *sc); +void mpssas_prepare_reinit(struct mps_softc *sc); void mpssas_handle_reinit(struct mps_softc *sc); void mps_base_static_config_pages(struct mps_softc *sc);