Author: kadesai
Date: Fri Jun 26 11:58:42 2015
New Revision: 284872
URL: https://svnweb.freebsd.org/changeset/base/284872

Log:
  Kernel panic may be observed by user, if MR controller is under Chip reset 
(OCR)
  and there are some pending IOs at the time of OCR. This is mainly because of
  recursive mutext in OCR and IO completion function call. Generic IO 
completion (from ISR) needs
  sim_lock to be held before it calls completion to CAM (xpt_done), but in case 
of OCR path mrsas_ocr thread
  itself take sim_lock, so this condition is now handled in this patch.
  
  MFC after:  3 days

Modified:
  head/sys/dev/mrsas/mrsas.c

Modified: head/sys/dev/mrsas/mrsas.c
==============================================================================
--- head/sys/dev/mrsas/mrsas.c  Fri Jun 26 09:02:40 2015        (r284871)
+++ head/sys/dev/mrsas/mrsas.c  Fri Jun 26 11:58:42 2015        (r284872)
@@ -2715,6 +2715,7 @@ mrsas_reset_ctrl(struct mrsas_softc *sc)
                    "resetting adapter from %s.\n",
                    __func__);
                /* Now return commands back to the CAM layer */
+               mtx_unlock(&sc->sim_lock);
                for (i = 0; i < sc->max_fw_cmds; i++) {
                        mpt_cmd = sc->mpt_cmd_list[i];
                        if (mpt_cmd->ccb_ptr) {
@@ -2724,6 +2725,7 @@ mrsas_reset_ctrl(struct mrsas_softc *sc)
                                mrsas_atomic_dec(&sc->fw_outstanding);
                        }
                }
+               mtx_lock(&sc->sim_lock);
 
                status_reg = mrsas_read_reg(sc, offsetof(mrsas_reg_set,
                    outbound_scratch_pad));
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to