Permalink
Browse files

Merge remote-tracking branch 'upstream/svn_stable_9' into svn_stable_9

  • Loading branch information...
2 parents 0e41544 + 2d574bd commit 67b00f283b69a3564d4a5cdb6f092b0611e16feb @lattera committed May 8, 2012
View
@@ -90,8 +90,6 @@ static int mfi_get_controller_info(struct mfi_softc *);
static int mfi_get_log_state(struct mfi_softc *,
struct mfi_evt_log_state **);
static int mfi_parse_entries(struct mfi_softc *, int, int);
-static int mfi_dcmd_command(struct mfi_softc *, struct mfi_command **,
- uint32_t, void **, size_t);
static void mfi_data_cb(void *, bus_dma_segment_t *, int, int);
static void mfi_startup(void *arg);
static void mfi_intr(void *arg);
@@ -377,6 +375,7 @@ mfi_attach(struct mfi_softc *sc)
TAILQ_INIT(&sc->mfi_syspd_tqh);
TAILQ_INIT(&sc->mfi_evt_queue);
TASK_INIT(&sc->mfi_evt_task, 0, mfi_handle_evt, sc);
+ TASK_INIT(&sc->mfi_map_sync_task, 0, mfi_handle_map_sync, sc);
TAILQ_INIT(&sc->mfi_aen_pids);
TAILQ_INIT(&sc->mfi_cam_ccbq);
@@ -696,7 +695,6 @@ mfi_attach(struct mfi_softc *sc)
return (EINVAL);
}
sc->mfi_enable_intr(sc);
- sc->map_id = 0;
} else {
if ((error = mfi_comms_init(sc)) != 0)
return (error);
@@ -762,6 +760,10 @@ mfi_attach(struct mfi_softc *sc)
callout_reset(&sc->mfi_watchdog_callout, MFI_CMD_TIMEOUT * hz,
mfi_timeout, sc);
+ if (sc->mfi_flags & MFI_FLAGS_TBOLT) {
+ mfi_tbolt_sync_map_info(sc);
+ }
+
return (0);
}
@@ -845,7 +847,7 @@ mfi_release_command(struct mfi_command *cm)
mfi_enqueue_free(cm);
}
-static int
+int
mfi_dcmd_command(struct mfi_softc *sc, struct mfi_command **cmp,
uint32_t opcode, void **bufp, size_t bufsize)
{
@@ -1286,8 +1288,8 @@ mfi_shutdown(struct mfi_softc *sc)
if (sc->mfi_aen_cm != NULL)
mfi_abort(sc, sc->mfi_aen_cm);
- if (sc->map_update_cmd != NULL)
- mfi_abort(sc, sc->map_update_cmd);
+ if (sc->mfi_map_sync_cm != NULL)
+ mfi_abort(sc, sc->mfi_map_sync_cm);
dcmd = &cm->cm_frame->dcmd;
dcmd->header.flags = MFI_FRAME_DIR_NONE;
@@ -1317,7 +1319,7 @@ mfi_syspdprobe(struct mfi_softc *sc)
/* Add SYSTEM PD's */
error = mfi_dcmd_command(sc, &cm, MFI_DCMD_PD_LIST_QUERY,
(void **)&pdlist, sizeof(*pdlist));
- if (error){
+ if (error) {
device_printf(sc->mfi_dev,
"Error while forming SYSTEM PD list\n");
goto out;
@@ -1664,9 +1666,9 @@ mfi_aen_complete(struct mfi_command *cm)
if (sc->mfi_aen_cm == NULL)
return;
- if (sc->mfi_aen_cm->cm_aen_abort ||
+ if (sc->cm_aen_abort ||
hdr->cmd_status == MFI_STAT_INVALID_STATUS) {
- sc->mfi_aen_cm->cm_aen_abort = 0;
+ sc->cm_aen_abort = 0;
aborted = 1;
} else {
sc->mfi_aen_triggered = 1;
@@ -1956,14 +1958,15 @@ mfi_add_sys_pd_complete(struct mfi_command *cm)
mtx_unlock(&Giant);
mtx_lock(&sc->mfi_io_lock);
}
+
static struct mfi_command *
mfi_bio_command(struct mfi_softc *sc)
{
struct bio *bio;
struct mfi_command *cm = NULL;
/*reserving two commands to avoid starvation for IOCTL*/
- if (sc->mfi_qstat[MFIQ_FREE].q_length < 2){
+ if (sc->mfi_qstat[MFIQ_FREE].q_length < 2) {
return (NULL);
}
if ((bio = mfi_dequeue_bio(sc)) == NULL) {
@@ -2385,7 +2388,9 @@ mfi_abort(struct mfi_softc *sc, struct mfi_command *cm_abort)
cm->cm_flags = MFI_CMD_POLLED;
if (sc->mfi_aen_cm)
- sc->mfi_aen_cm->cm_aen_abort = 1;
+ sc->cm_aen_abort = 1;
+ if (sc->mfi_map_sync_cm)
+ sc->cm_map_abort = 1;
mfi_mapcmd(sc, cm);
mfi_release_command(cm);
@@ -2394,6 +2399,11 @@ mfi_abort(struct mfi_softc *sc, struct mfi_command *cm_abort)
5 * hz);
i++;
}
+ while (i < 5 && sc->mfi_map_sync_cm != NULL) {
+ msleep(&sc->mfi_map_sync_cm, &sc->mfi_io_lock, 0, "mfiabort",
+ 5 * hz);
+ i++;
+ }
return (0);
}
@@ -2685,12 +2695,12 @@ static int mfi_check_for_sscd(struct mfi_softc *sc, struct mfi_command *cm)
int error = 0;
if ((cm->cm_frame->dcmd.opcode == MFI_DCMD_CFG_ADD) &&
- (conf_data->ld[0].params.isSSCD == 1)){
+ (conf_data->ld[0].params.isSSCD == 1)) {
error = 1;
} else if (cm->cm_frame->dcmd.opcode == MFI_DCMD_LD_DELETE) {
error = mfi_dcmd_command (sc, &ld_cm, MFI_DCMD_LD_GET_INFO,
(void **)&ld_info, sizeof(*ld_info));
- if (error){
+ if (error) {
device_printf(sc->mfi_dev, "Failed to allocate"
"MFI_DCMD_LD_GET_INFO %d", error);
if (ld_info)
@@ -2700,7 +2710,7 @@ static int mfi_check_for_sscd(struct mfi_softc *sc, struct mfi_command *cm)
ld_cm->cm_flags = MFI_CMD_DATAIN;
ld_cm->cm_frame->dcmd.mbox[0]= cm->cm_frame->dcmd.mbox[0];
ld_cm->cm_frame->header.target_id = cm->cm_frame->dcmd.mbox[0];
- if (mfi_wait_command(sc, ld_cm) != 0){
+ if (mfi_wait_command(sc, ld_cm) != 0) {
device_printf(sc->mfi_dev, "failed to get log drv\n");
mfi_release_command(ld_cm);
free(ld_info, M_MFIBUF);
@@ -3549,9 +3559,9 @@ mfi_timeout(void *data)
}
mtx_lock(&sc->mfi_io_lock);
TAILQ_FOREACH(cm, &sc->mfi_busy, cm_link) {
- if (sc->mfi_aen_cm == cm)
+ if (sc->mfi_aen_cm == cm || sc->mfi_map_sync_cm == cm)
continue;
- if ((sc->mfi_aen_cm != cm) && (cm->cm_timestamp < deadline)) {
+ if (cm->cm_timestamp < deadline) {
if (sc->adpreset != 0 && sc->issuepend_done == 0) {
cm->cm_timestamp = time_uptime;
} else {
View
@@ -172,6 +172,9 @@ mfi_print_dcmd(struct mfi_softc *sc, device_t dev, struct mfi_command *cm)
case MFI_DCMD_CLUSTER_RESET_LD:
opcode = "CLUSTER_RESET_LD";
break;
+ case MFI_DCMD_LD_MAP_GET_INFO:
+ opcode = "LD_MAP_GET_INFO";
+ break;
default:
opcode = "UNKNOWN";
break;
View
@@ -256,17 +256,17 @@ mfi_disk_strategy(struct bio *bio)
return;
}
- if (controller->adpreset){
+ if (controller->adpreset) {
bio->bio_error = EBUSY;
return;
}
- if (controller->hw_crit_error){
+ if (controller->hw_crit_error) {
bio->bio_error = EBUSY;
return;
}
- if (controller->issuepend_done == 0){
+ if (controller->issuepend_done == 0) {
bio->bio_error = EBUSY;
return;
}
Oops, something went wrong.

0 comments on commit 67b00f2

Please sign in to comment.