Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Jun 2015 11:58:42 +0000 (UTC)
From:      Kashyap D Desai <kadesai@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r284872 - head/sys/dev/mrsas
Message-ID:  <201506261158.t5QBwgRj091064@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201506261158.t5QBwgRj091064>