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


9839                                 continue;
9840                         }
9841                 }
9842 
9843                 /*
9844                  * Check if controller is in a FAULT state. If so, reset it.
9845                  */
9846                 doorbell = ddi_get32(mpt->m_datap, &mpt->m_reg->Doorbell);
9847                 if ((doorbell & MPI2_IOC_STATE_MASK) == MPI2_IOC_STATE_FAULT) {
9848                         doorbell &= MPI2_DOORBELL_DATA_MASK;
9849                         mptsas_log(mpt, CE_WARN, "MPT Firmware Fault, "
9850                             "code: %04x", doorbell);
9851                         mpt->m_softstate &= ~MPTSAS_SS_MSG_UNIT_RESET;
9852                         if ((mptsas_restart_ioc(mpt)) == DDI_FAILURE) {
9853                                 mptsas_log(mpt, CE_WARN, "Reset failed"
9854                                     "after fault was detected");
9855                         }
9856                 }
9857 
9858                 /*




















9859                  * For now, always call mptsas_watchsubr.
9860                  */
9861                 mptsas_watchsubr(mpt);
9862 
9863                 if (mpt->m_options & MPTSAS_OPT_PM) {
9864                         mpt->m_busy = 0;
9865                         (void) pm_idle_component(mpt->m_dip, 0);
9866                 }
9867 
9868                 mutex_exit(&mpt->m_mutex);
9869         }
9870         rw_exit(&mptsas_global_rwlock);
9871 
9872         mutex_enter(&mptsas_global_mutex);
9873         if (mptsas_timeouts_enabled)
9874                 mptsas_timeout_id = timeout(mptsas_watch, NULL, mptsas_tick);
9875         mutex_exit(&mptsas_global_mutex);
9876 }
9877 
9878 static void




9839                                 continue;
9840                         }
9841                 }
9842 
9843                 /*
9844                  * Check if controller is in a FAULT state. If so, reset it.
9845                  */
9846                 doorbell = ddi_get32(mpt->m_datap, &mpt->m_reg->Doorbell);
9847                 if ((doorbell & MPI2_IOC_STATE_MASK) == MPI2_IOC_STATE_FAULT) {
9848                         doorbell &= MPI2_DOORBELL_DATA_MASK;
9849                         mptsas_log(mpt, CE_WARN, "MPT Firmware Fault, "
9850                             "code: %04x", doorbell);
9851                         mpt->m_softstate &= ~MPTSAS_SS_MSG_UNIT_RESET;
9852                         if ((mptsas_restart_ioc(mpt)) == DDI_FAILURE) {
9853                                 mptsas_log(mpt, CE_WARN, "Reset failed"
9854                                     "after fault was detected");
9855                         }
9856                 }
9857                 
9858                 /*
9859                  * If we set the "please reset me" flag, then reset.
9860                  */
9861                 if (mpt->m_softstate & MPTSAS_SS_RESET_INWATCH) {
9862                         doorbell = ddi_get32(mpt->m_datap,
9863                             &mpt->m_reg->Doorbell);
9864                         mptsas_log(mpt, CE_WARN, "MPT Forced Reset, "
9865                             "doorbell: %04x", doorbell);
9866                         mpt->m_softstate &= ~MPTSAS_SS_MSG_UNIT_RESET;
9867                         if (mpt->m_softstate & MPTSAS_SS_MUR_INWATCH)
9868                                 mpt->m_softstate |= MPTSAS_SS_MSG_UNIT_RESET;
9869                         mpt->m_softstate &= ~(MPTSAS_SS_RESET_INWATCH|
9870                             MPTSAS_SS_MUR_INWATCH);
9871                         if ((mptsas_restart_ioc(mpt)) == DDI_FAILURE) {
9872                                 mptsas_log(mpt, CE_WARN, "Reset failed"
9873                                     "after fault was detected");
9874                         }
9875                 }
9876                 
9877 
9878                 /*
9879                  * For now, always call mptsas_watchsubr.
9880                  */
9881                 mptsas_watchsubr(mpt);
9882 
9883                 if (mpt->m_options & MPTSAS_OPT_PM) {
9884                         mpt->m_busy = 0;
9885                         (void) pm_idle_component(mpt->m_dip, 0);
9886                 }
9887 
9888                 mutex_exit(&mpt->m_mutex);
9889         }
9890         rw_exit(&mptsas_global_rwlock);
9891 
9892         mutex_enter(&mptsas_global_mutex);
9893         if (mptsas_timeouts_enabled)
9894                 mptsas_timeout_id = timeout(mptsas_watch, NULL, mptsas_tick);
9895         mutex_exit(&mptsas_global_mutex);
9896 }
9897 
9898 static void