summaryrefslogtreecommitdiffstats
path: root/sys/dev/mfi
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2013-08-23 22:55:52 +0000
committermarkj <markj@FreeBSD.org>2013-08-23 22:55:52 +0000
commit0b9d56c1654a1504ab090d8cbab2d9ef1ba4c384 (patch)
tree18ab1550f59c1a876ba2293d5410105a58c18a3d /sys/dev/mfi
parentb93cf732047c8ac0128b11fd4cc88d223c23f0b7 (diff)
downloadFreeBSD-src-0b9d56c1654a1504ab090d8cbab2d9ef1ba4c384.zip
FreeBSD-src-0b9d56c1654a1504ab090d8cbab2d9ef1ba4c384.tar.gz
Hold mfi_io_lock across calls to xpt_rescan() and xpt_alloc_ccb_nowait().
xpt_rescan() expects the SIM lock to be held, and we trip a mtx_assert if the driver initiates multiple rescans in quick succession. Reported by: sbruno Tested by: sbruno MFC after: 1 week
Diffstat (limited to 'sys/dev/mfi')
-rw-r--r--sys/dev/mfi/mfi_cam.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/sys/dev/mfi/mfi_cam.c b/sys/dev/mfi/mfi_cam.c
index b6ceb57..e21b089 100644
--- a/sys/dev/mfi/mfi_cam.c
+++ b/sys/dev/mfi/mfi_cam.c
@@ -308,17 +308,16 @@ mfip_cam_rescan(struct mfi_softc *sc, uint32_t tid)
return;
}
camsc->state = MFIP_STATE_RESCAN;
- mtx_unlock(&sc->mfi_io_lock);
ccb = xpt_alloc_ccb_nowait();
if (ccb == NULL) {
+ mtx_unlock(&sc->mfi_io_lock);
device_printf(sc->mfi_dev,
"Cannot allocate ccb for bus rescan.\n");
return;
}
sim = camsc->sim;
- mtx_lock(&sc->mfi_io_lock);
if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sim),
tid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
xpt_free_ccb(ccb);
@@ -327,11 +326,8 @@ mfip_cam_rescan(struct mfi_softc *sc, uint32_t tid)
"Cannot create path for bus rescan.\n");
return;
}
- mtx_unlock(&sc->mfi_io_lock);
-
xpt_rescan(ccb);
- mtx_lock(&sc->mfi_io_lock);
camsc->state = MFIP_STATE_NONE;
mtx_unlock(&sc->mfi_io_lock);
}
OpenPOWER on IntegriCloud