diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index d814c0ef6d89..cc069325748c 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -470,6 +470,12 @@ cam_periph_release(struct cam_periph *periph) mtx_unlock(mtx); } +/* + * hold/unhold act as mutual exclusion for sections of the code that + * need to sleep and want to make sure that other sections that + * will interfere are held off. This only protects exclusive sections + * from each other. + */ int cam_periph_hold(struct cam_periph *periph, int priority) { diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 701d141ff61e..2483c5e7633e 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -2697,9 +2697,10 @@ daregister(struct cam_periph *periph, void *arg) TASK_INIT(&softc->sysctl_task, 0, dasysctlinit, periph); /* - * Take an exclusive refcount on the periph while dastart is called - * to finish the probe. The reference will be dropped in dadone at - * the end of probe. + * Take an exclusive section lock qon the periph while dastart is called + * to finish the probe. The lock will be dropped in dadone at the end + * of probe. This locks out daopen and daclose from racing with the + * probe. * * XXX if cam_periph_hold returns an error, we don't hold a refcount. */