Author: ken
Date: Wed May  7 05:14:48 2014
New Revision: 265485
URL: http://svnweb.freebsd.org/changeset/base/265485

Log:
  Hold the SIM lock when calling xpt_create_path() and xpt_action() in
  mprsas_SSU_to_SATA_devices().
  
  This fixes an assertion on shutdown with INVARIANTS enabled with SATA
  drives present on an IR firmware controller.
  
  Reviewed by:  Steve McConnell <stephen.mcconn...@avagotech.com>.
  MFC after:    3 days

Modified:
  head/sys/dev/mpr/mpr_sas_lsi.c

Modified: head/sys/dev/mpr/mpr_sas_lsi.c
==============================================================================
--- head/sys/dev/mpr/mpr_sas_lsi.c      Wed May  7 05:11:16 2014        
(r265484)
+++ head/sys/dev/mpr/mpr_sas_lsi.c      Wed May  7 05:14:48 2014        
(r265485)
@@ -1026,6 +1026,8 @@ mprsas_SSU_to_SATA_devices(struct mpr_so
        char path_str[64];
        struct timeval cur_time, start_time;
 
+       mpr_lock(sc);
+
        /*
         * For each LUN of each target, issue a StartStopUnit command to stop
         * the device.
@@ -1041,6 +1043,7 @@ mprsas_SSU_to_SATA_devices(struct mpr_so
                SLIST_FOREACH(lun, &target->luns, lun_link) {
                        ccb = xpt_alloc_ccb_nowait();
                        if (ccb == NULL) {
+                               mpr_unlock(sc);
                                mpr_dprint(sc, MPR_FAULT, "Unable to alloc "
                                    "CCB to stop unit.\n");
                                return;
@@ -1057,6 +1060,7 @@ mprsas_SSU_to_SATA_devices(struct mpr_so
                                        mpr_dprint(sc, MPR_FAULT, "Unable to "
                                            "create LUN path to stop unit.\n");
                                        xpt_free_ccb(ccb);
+                                       mpr_unlock(sc);
                                        return;
                                }
                                xpt_path_string(ccb->ccb_h.path, path_str,
@@ -1092,6 +1096,8 @@ mprsas_SSU_to_SATA_devices(struct mpr_so
                }
        }
 
+       mpr_unlock(sc);
+
        /*
         * Wait until all of the SSU commands have completed or time has
         * expired (60 seconds).  pause for 100ms each time through.  If any
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to