aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/mpr/mpr_sas.c31
-rw-r--r--sys/dev/mpr/mpr_user.c2
-rw-r--r--sys/dev/mpr/mprvar.h2
-rw-r--r--sys/dev/mps/mps_sas.c28
-rw-r--r--sys/dev/mps/mps_user.c2
-rw-r--r--sys/dev/mps/mpsvar.h2
6 files changed, 28 insertions, 39 deletions
diff --git a/sys/dev/mpr/mpr_sas.c b/sys/dev/mpr/mpr_sas.c
index 93c27803867a..eeb321af0da2 100644
--- a/sys/dev/mpr/mpr_sas.c
+++ b/sys/dev/mpr/mpr_sas.c
@@ -229,9 +229,12 @@ mprsas_startup_decrement(struct mprsas_softc *sassc)
}
}
-/* The firmware requires us to stop sending commands when we're doing task
- * management, so refcount the TMs and keep the simq frozen when any are in
+/*
+ * The firmware requires us to stop sending commands when we're doing task
+ * management.
* use.
+ * XXX The logic for serializing the device has been made lazy and moved to
+ * mprsas_prepare_for_tm().
*/
struct mpr_command *
mprsas_alloc_tm(struct mpr_softc *sc)
@@ -467,8 +470,6 @@ mprsas_prepare_volume_remove(struct mprsas_softc *sassc, uint16_t handle)
cm->cm_targ = targ;
cm->cm_data = NULL;
- cm->cm_desc.HighPriority.RequestFlags =
- MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
cm->cm_complete = mprsas_remove_volume;
cm->cm_complete_data = (void *)(uintptr_t)handle;
@@ -531,8 +532,6 @@ mprsas_prepare_remove(struct mprsas_softc *sassc, uint16_t handle)
cm->cm_targ = targ;
cm->cm_data = NULL;
- cm->cm_desc.HighPriority.RequestFlags =
- MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
cm->cm_complete = mprsas_remove_device;
cm->cm_complete_data = (void *)(uintptr_t)handle;
@@ -1494,8 +1493,6 @@ mprsas_send_reset(struct mpr_softc *sc, struct mpr_command *tm, uint8_t type)
}
tm->cm_data = NULL;
- tm->cm_desc.HighPriority.RequestFlags =
- MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
tm->cm_complete_data = (void *)tm;
callout_reset(&tm->cm_callout, MPR_RESET_TIMEOUT * hz,
@@ -1623,8 +1620,6 @@ mprsas_send_abort(struct mpr_softc *sc, struct mpr_command *tm,
req->TaskMID = htole16(cm->cm_desc.Default.SMID);
tm->cm_data = NULL;
- tm->cm_desc.HighPriority.RequestFlags =
- MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
tm->cm_complete = mprsas_abort_complete;
tm->cm_complete_data = (void *)tm;
tm->cm_targ = cm->cm_targ;
@@ -3336,8 +3331,6 @@ mprsas_action_resetdev(struct mprsas_softc *sassc, union ccb *ccb)
req->MsgFlags = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET;
tm->cm_data = NULL;
- tm->cm_desc.HighPriority.RequestFlags =
- MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
tm->cm_complete = mprsas_resetdev_complete;
tm->cm_complete_data = ccb;
@@ -3750,6 +3743,13 @@ mprsas_read_cap_done(struct cam_periph *periph, union ccb *done_ccb)
#endif /* (__FreeBSD_version < 901503) || \
((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000006)) */
+/*
+ * Set the INRESET flag for this target so that no I/O will be sent to
+ * the target until the reset has completed. If an I/O request does
+ * happen, the devq will be frozen. The CCB holds the path which is
+ * used to release the devq. The devq is released and the CCB is freed
+ * when the TM completes.
+ */
void
mprsas_prepare_for_tm(struct mpr_softc *sc, struct mpr_command *tm,
struct mprsas_target *target, lun_id_t lun_id)
@@ -3757,13 +3757,6 @@ mprsas_prepare_for_tm(struct mpr_softc *sc, struct mpr_command *tm,
union ccb *ccb;
path_id_t path_id;
- /*
- * Set the INRESET flag for this target so that no I/O will be sent to
- * the target until the reset has completed. If an I/O request does
- * happen, the devq will be frozen. The CCB holds the path which is
- * used to release the devq. The devq is released and the CCB is freed
- * when the TM completes.
- */
ccb = xpt_alloc_ccb_nowait();
if (ccb) {
path_id = cam_sim_path(sc->sassc->sim);
diff --git a/sys/dev/mpr/mpr_user.c b/sys/dev/mpr/mpr_user.c
index 2c9354d12da3..55b03f697846 100644
--- a/sys/dev/mpr/mpr_user.c
+++ b/sys/dev/mpr/mpr_user.c
@@ -835,8 +835,6 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru_t *data)
task->TaskMID = cm->cm_desc.Default.SMID;
cm->cm_data = NULL;
- cm->cm_desc.HighPriority.RequestFlags =
- MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
cm->cm_complete = NULL;
cm->cm_complete_data = NULL;
diff --git a/sys/dev/mpr/mprvar.h b/sys/dev/mpr/mprvar.h
index c246ba4740a1..0bbc2ece599c 100644
--- a/sys/dev/mpr/mprvar.h
+++ b/sys/dev/mpr/mprvar.h
@@ -657,6 +657,8 @@ mpr_alloc_high_priority_command(struct mpr_softc *sc)
TAILQ_REMOVE(&sc->high_priority_req_list, cm, cm_link);
cm->cm_state = MPR_CM_STATE_BUSY;
cm->cm_timeout_handler = NULL;
+ cm->cm_desc.HighPriority.RequestFlags =
+ MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
return (cm);
}
diff --git a/sys/dev/mps/mps_sas.c b/sys/dev/mps/mps_sas.c
index 8e049fdb4383..382191193dc1 100644
--- a/sys/dev/mps/mps_sas.c
+++ b/sys/dev/mps/mps_sas.c
@@ -227,9 +227,11 @@ mpssas_startup_decrement(struct mpssas_softc *sassc)
}
}
-/* The firmware requires us to stop sending commands when we're doing task
- * management, so refcount the TMs and keep the simq frozen when any are in
- * use.
+/*
+ * The firmware requires us to stop sending commands when we're doing task
+ * management.
+ * XXX The logic for serializing the device has been made lazy and moved to
+ * mpssas_prepare_for_tm().
*/
struct mps_command *
mpssas_alloc_tm(struct mps_softc *sc)
@@ -472,8 +474,6 @@ mpssas_prepare_volume_remove(struct mpssas_softc *sassc, uint16_t handle)
cm->cm_targ = targ;
cm->cm_data = NULL;
- cm->cm_desc.HighPriority.RequestFlags =
- MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
cm->cm_complete = mpssas_remove_volume;
cm->cm_complete_data = (void *)(uintptr_t)handle;
@@ -536,7 +536,6 @@ mpssas_prepare_remove(struct mpssas_softc *sassc, uint16_t handle)
cm->cm_targ = targ;
cm->cm_data = NULL;
- cm->cm_desc.HighPriority.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
cm->cm_complete = mpssas_remove_device;
cm->cm_complete_data = (void *)(uintptr_t)handle;
@@ -1428,7 +1427,6 @@ mpssas_send_reset(struct mps_softc *sc, struct mps_command *tm, uint8_t type)
}
tm->cm_data = NULL;
- tm->cm_desc.HighPriority.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
tm->cm_complete_data = (void *)tm;
callout_reset(&tm->cm_callout, MPS_RESET_TIMEOUT * hz,
@@ -1557,7 +1555,6 @@ mpssas_send_abort(struct mps_softc *sc, struct mps_command *tm, struct mps_comma
req->TaskMID = htole16(cm->cm_desc.Default.SMID);
tm->cm_data = NULL;
- tm->cm_desc.HighPriority.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
tm->cm_complete = mpssas_abort_complete;
tm->cm_complete_data = (void *)tm;
tm->cm_targ = cm->cm_targ;
@@ -3079,7 +3076,6 @@ mpssas_action_resetdev(struct mpssas_softc *sassc, union ccb *ccb)
req->MsgFlags = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET;
tm->cm_data = NULL;
- tm->cm_desc.HighPriority.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
tm->cm_complete = mpssas_resetdev_complete;
tm->cm_complete_data = ccb;
tm->cm_targ = targ;
@@ -3475,6 +3471,13 @@ mpssas_read_cap_done(struct cam_periph *periph, union ccb *done_ccb)
#endif /* (__FreeBSD_version < 901503) || \
((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000006)) */
+/*
+ * Set the INRESET flag for this target so that no I/O will be sent to
+ * the target until the reset has completed. If an I/O request does
+ * happen, the devq will be frozen. The CCB holds the path which is
+ * used to release the devq. The devq is released and the CCB is freed
+ * when the TM completes.
+ */
void
mpssas_prepare_for_tm(struct mps_softc *sc, struct mps_command *tm,
struct mpssas_target *target, lun_id_t lun_id)
@@ -3482,13 +3485,6 @@ mpssas_prepare_for_tm(struct mps_softc *sc, struct mps_command *tm,
union ccb *ccb;
path_id_t path_id;
- /*
- * Set the INRESET flag for this target so that no I/O will be sent to
- * the target until the reset has completed. If an I/O request does
- * happen, the devq will be frozen. The CCB holds the path which is
- * used to release the devq. The devq is released and the CCB is freed
- * when the TM completes.
- */
ccb = xpt_alloc_ccb_nowait();
if (ccb) {
path_id = cam_sim_path(sc->sassc->sim);
diff --git a/sys/dev/mps/mps_user.c b/sys/dev/mps/mps_user.c
index 1770df60e1e2..c64fad459275 100644
--- a/sys/dev/mps/mps_user.c
+++ b/sys/dev/mps/mps_user.c
@@ -847,8 +847,6 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru_t *data)
task->TaskMID = cm->cm_desc.Default.SMID;
cm->cm_data = NULL;
- cm->cm_desc.HighPriority.RequestFlags =
- MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
cm->cm_complete = NULL;
cm->cm_complete_data = NULL;
diff --git a/sys/dev/mps/mpsvar.h b/sys/dev/mps/mpsvar.h
index 451e355f3fb9..cb173ab3aa59 100644
--- a/sys/dev/mps/mpsvar.h
+++ b/sys/dev/mps/mpsvar.h
@@ -625,6 +625,8 @@ mps_alloc_high_priority_command(struct mps_softc *sc)
TAILQ_REMOVE(&sc->high_priority_req_list, cm, cm_link);
cm->cm_state = MPS_CM_STATE_BUSY;
cm->cm_timeout_handler = NULL;
+ cm->cm_desc.HighPriority.RequestFlags =
+ MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
return (cm);
}