diff options
author | Kenneth D. Merry <ken@FreeBSD.org> | 2014-05-07 05:14:48 +0000 |
---|---|---|
committer | Kenneth D. Merry <ken@FreeBSD.org> | 2014-05-07 05:14:48 +0000 |
commit | 63941e9834320bc21d92c567292eadce7873c831 (patch) | |
tree | a5350c7d0d31043b7560e1abea9613dcd497b743 | |
parent | 09e25c0e8aa1d1fcdef7b90052b3407b580ab1f1 (diff) | |
download | src-63941e9834320bc21d92c567292eadce7873c831.tar.gz src-63941e9834320bc21d92c567292eadce7873c831.zip |
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.mcconnell@avagotech.com>.
MFC after: 3 days
Notes
Notes:
svn path=/head/; revision=265485
-rw-r--r-- | sys/dev/mpr/mpr_sas_lsi.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/mpr/mpr_sas_lsi.c b/sys/dev/mpr/mpr_sas_lsi.c index cf5be2b26d29..d8572fd8e4e6 100644 --- a/sys/dev/mpr/mpr_sas_lsi.c +++ b/sys/dev/mpr/mpr_sas_lsi.c @@ -1026,6 +1026,8 @@ mprsas_SSU_to_SATA_devices(struct mpr_softc *sc) 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_softc *sc) 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_softc *sc) 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_softc *sc) } } + 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 |