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 */
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to