Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Feb 2013 00:35:41 +0000 (UTC)
From:      Steven Hartland <smh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r247367 - head/sys/dev/mfi
Message-ID:  <201302270035.r1R0Zft7028012@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: smh
Date: Wed Feb 27 00:35:40 2013
New Revision: 247367
URL: http://svnweb.freebsd.org/changeset/base/247367

Log:
  Fixes mfi panic on recused on non-recusive mutex MFI I/O lock
  
  Removes a mtx_unlock call for mfi_io_lock which is never aquired
  
  While I'm here fix a braceing style issue.
  
  Reviewed by:	Doug Ambrisko
  Approved by:	pjd (mentor)
  MFC after:	1 month

Modified:
  head/sys/dev/mfi/mfi.c
  head/sys/dev/mfi/mfi_tbolt.c

Modified: head/sys/dev/mfi/mfi.c
==============================================================================
--- head/sys/dev/mfi/mfi.c	Wed Feb 27 00:25:44 2013	(r247366)
+++ head/sys/dev/mfi/mfi.c	Wed Feb 27 00:35:40 2013	(r247367)
@@ -723,10 +723,8 @@ mfi_attach(struct mfi_softc *sc)
 		    "hook\n");
 		return (EINVAL);
 	}
-	if ((error = mfi_aen_setup(sc, 0), 0) != 0) {
-		mtx_unlock(&sc->mfi_io_lock);
+	if ((error = mfi_aen_setup(sc, 0), 0) != 0)
 		return (error);
-	}
 
 	/*
 	 * Register a shutdown handler.

Modified: head/sys/dev/mfi/mfi_tbolt.c
==============================================================================
--- head/sys/dev/mfi/mfi_tbolt.c	Wed Feb 27 00:25:44 2013	(r247366)
+++ head/sys/dev/mfi/mfi_tbolt.c	Wed Feb 27 00:35:40 2013	(r247367)
@@ -1194,6 +1194,7 @@ mfi_process_fw_state_chg_isr(void *arg)
 			sc->hw_crit_error= 1;
 			return ;
 		}
+		mtx_unlock(&sc->mfi_io_lock);
 		if ((error = mfi_tbolt_init_MFI_queue(sc)) != 0)
 				return;
 
@@ -1225,7 +1226,9 @@ mfi_process_fw_state_chg_isr(void *arg)
 			/*
 			 * Initiate AEN (Asynchronous Event Notification)
 			 */
+			mtx_unlock(&sc->mfi_io_lock);
 			mfi_aen_setup(sc, sc->last_seq_num);
+			mtx_lock(&sc->mfi_io_lock);
 			sc->issuepend_done = 1;
 			device_printf(sc->mfi_dev, "second stage of reset "
 			    "complete, FW is ready now.\n");
@@ -1237,7 +1240,6 @@ mfi_process_fw_state_chg_isr(void *arg)
 		device_printf(sc->mfi_dev, "mfi_process_fw_state_chg_isr "
 		    "called with unhandled value:%d\n", sc->adpreset);
 	}
-	mtx_unlock(&sc->mfi_io_lock);
 }
 
 /*



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