Print this page
First attempt at pulling 4310 fix from Andy Giles tree


1179                         reply_size = sizeof (MPI2_SCSI_TASK_MANAGE_REPLY);
1180                 }
1181                 mutex_exit(&mpt->m_mutex);
1182                 for (i = 0; i < reply_size; i++) {
1183                         if (ddi_copyout((uint8_t *)reply_msg + i, reply + i, 1,
1184                             mode)) {
1185                                 mptsas_log(mpt, CE_WARN, "failed to copy out "
1186                                     "reply data for TM request");
1187                                 break;
1188                         }
1189                 }
1190                 mutex_enter(&mpt->m_mutex);
1191         }
1192 
1193         /*
1194          * clear the TM slot before returning
1195          */
1196         slots->m_slot[MPTSAS_TM_SLOT(mpt)] = NULL;
1197 
1198         /*
1199          * If we lost our task management command
1200          * we need to reset the ioc


1201          */
1202         if (rval == FALSE) {
1203                 mptsas_log(mpt, CE_WARN, "mptsas_ioc_task_management failed "
1204                     "try to reset ioc to recovery!");
1205                 mpt->m_softstate &= ~MPTSAS_SS_MSG_UNIT_RESET;
1206                 if (mptsas_restart_ioc(mpt)) {
1207                         mptsas_log(mpt, CE_WARN, "mptsas_restart_ioc failed");
1208                         rval = FAILED;
1209                 }
1210         }
1211 
1212         return (rval);
1213 }
1214 
1215 /*
1216  * Complete firmware download frame for v2.0 cards.
1217  */
1218 static void
1219 mptsas_uflash2(pMpi2FWDownloadRequest fwdownload,
1220     ddi_acc_handle_t acc_hdl, uint32_t size, uint8_t type,
1221     ddi_dma_cookie_t flsh_cookie)
1222 {
1223         pMpi2FWDownloadTCSGE_t  tcsge;
1224         pMpi2SGESimple64_t      sge;
1225         uint32_t                flagslength;
1226 
1227         ddi_put8(acc_hdl, &fwdownload->Function,
1228             MPI2_FUNCTION_FW_DOWNLOAD);
1229         ddi_put8(acc_hdl, &fwdownload->ImageType, type);




1179                         reply_size = sizeof (MPI2_SCSI_TASK_MANAGE_REPLY);
1180                 }
1181                 mutex_exit(&mpt->m_mutex);
1182                 for (i = 0; i < reply_size; i++) {
1183                         if (ddi_copyout((uint8_t *)reply_msg + i, reply + i, 1,
1184                             mode)) {
1185                                 mptsas_log(mpt, CE_WARN, "failed to copy out "
1186                                     "reply data for TM request");
1187                                 break;
1188                         }
1189                 }
1190                 mutex_enter(&mpt->m_mutex);
1191         }
1192 
1193         /*
1194          * clear the TM slot before returning
1195          */
1196         slots->m_slot[MPTSAS_TM_SLOT(mpt)] = NULL;
1197 
1198         /*
1199          * If we lost our task management command we need to reset the ioc
1200          * but we can't do it here as it's most likely we were called from
1201          * the taskq that mptsas_restart_ioc()->mptsas_flush_hba() needs to
1202          * wait for. So set a flag for mptsas_watch().
1203          */
1204         if (rval == FALSE) {
1205                 mptsas_log(mpt, CE_WARN, "mptsas_ioc_task_management failed "
1206                     "schedule reset in watch!");
1207                 mpt->m_softstate |= MPTSAS_SS_RESET_INWATCH;




1208         }
1209         
1210         return (rval);
1211 }
1212 
1213 /*
1214  * Complete firmware download frame for v2.0 cards.
1215  */
1216 static void
1217 mptsas_uflash2(pMpi2FWDownloadRequest fwdownload,
1218     ddi_acc_handle_t acc_hdl, uint32_t size, uint8_t type,
1219     ddi_dma_cookie_t flsh_cookie)
1220 {
1221         pMpi2FWDownloadTCSGE_t  tcsge;
1222         pMpi2SGESimple64_t      sge;
1223         uint32_t                flagslength;
1224 
1225         ddi_put8(acc_hdl, &fwdownload->Function,
1226             MPI2_FUNCTION_FW_DOWNLOAD);
1227         ddi_put8(acc_hdl, &fwdownload->ImageType, type);