Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Dec 2009 11:48:53 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r200180 - in head/sys/cam: . ata
Message-ID:  <200912061148.nB6BmruQ020118@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sun Dec  6 11:48:53 2009
New Revision: 200180
URL: http://svn.freebsd.org/changeset/base/200180

Log:
  MFp4:
  If we panicked with SIM lock held, do not try to flush caches.
  Extra lock recursing will not make debugging easier.

Modified:
  head/sys/cam/ata/ata_da.c
  head/sys/cam/cam_periph.h

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c	Sun Dec  6 09:36:11 2009	(r200179)
+++ head/sys/cam/ata/ata_da.c	Sun Dec  6 11:48:53 2009	(r200180)
@@ -1040,6 +1040,9 @@ adashutdown(void * arg, int howto)
 	TAILQ_FOREACH(periph, &adadriver.units, unit_links) {
 		union ccb ccb;
 
+		/* If we paniced with lock held - not recurse here. */
+		if (cam_periph_owned(periph))
+			continue;
 		cam_periph_lock(periph);
 		softc = (struct ada_softc *)periph->softc;
 		/*

Modified: head/sys/cam/cam_periph.h
==============================================================================
--- head/sys/cam/cam_periph.h	Sun Dec  6 09:36:11 2009	(r200179)
+++ head/sys/cam/cam_periph.h	Sun Dec  6 11:48:53 2009	(r200180)
@@ -190,5 +190,11 @@ cam_periph_unlock(struct cam_periph *per
 	mtx_unlock(periph->sim->mtx);
 }
 
+static __inline int
+cam_periph_owned(struct cam_periph *periph)
+{
+	return (mtx_owned(periph->sim->mtx));
+}
+
 #endif /* _KERNEL */
 #endif /* _CAM_CAM_PERIPH_H */



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