summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_xpt.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2012-10-13 10:18:36 +0000
committermav <mav@FreeBSD.org>2012-10-13 10:18:36 +0000
commitfd248e3cc6efbfa8fea63db25b19a2696e96fb9e (patch)
treefc66c6a4a3e110370cffc82a3df7045cb8b7cb1c /sys/cam/cam_xpt.c
parent85ee5d74ce424b8e28c97eb96de7e7bfa2d34c4b (diff)
downloadFreeBSD-src-fd248e3cc6efbfa8fea63db25b19a2696e96fb9e.zip
FreeBSD-src-fd248e3cc6efbfa8fea63db25b19a2696e96fb9e.tar.gz
XPT_DEV_MATCH is probably the only xpt_action() method that is called
without holding SIM lock. It really doesn't need that lock, but adding it removes that specific exception, allowing to assert locking there later. Submitted by: ken@ (earlier version)
Diffstat (limited to 'sys/cam/cam_xpt.c')
-rw-r--r--sys/cam/cam_xpt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index a5ae5bc..0758979 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -582,7 +582,9 @@ xptioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td
/*
* This is an immediate CCB, we can send it on directly.
*/
+ CAM_SIM_LOCK(xpt_path_sim(xpt_periph->path));
xpt_action(inccb);
+ CAM_SIM_UNLOCK(xpt_path_sim(xpt_periph->path));
/*
* Map the buffers back into user space.
@@ -2818,6 +2820,11 @@ xpt_action_default(union ccb *start_ccb)
position_type = CAM_DEV_POS_PDRV;
}
+ /*
+ * Note that we drop the SIM lock here, because the EDT
+ * traversal code needs to do its own locking.
+ */
+ CAM_SIM_UNLOCK(xpt_path_sim(cdm->ccb_h.path));
switch(position_type & CAM_DEV_POS_TYPEMASK) {
case CAM_DEV_POS_EDT:
xptedtmatch(cdm);
@@ -2829,6 +2836,7 @@ xpt_action_default(union ccb *start_ccb)
cdm->status = CAM_DEV_MATCH_ERROR;
break;
}
+ CAM_SIM_LOCK(xpt_path_sim(cdm->ccb_h.path));
if (cdm->status == CAM_DEV_MATCH_ERROR)
start_ccb->ccb_h.status = CAM_REQ_CMP_ERR;
OpenPOWER on IntegriCloud