From 7605c12c0f2bf784960d36288b7cb6e451b99a15 Mon Sep 17 00:00:00 2001 From: scottl Date: Sun, 15 Apr 2007 08:49:19 +0000 Subject: Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM will use to synchornize and protect all data objects that are used for that SIM. Drivers that are not yet MPSAFE register Giant and operate as usual. RIght now, no drivers are MPSAFE, though a few will be changed in the coming week as this work settles down. The driver API has changed, so all CAM drivers will need to be recompiled. The userland API has not changed, so tools like camcontrol do not need to be recompiled. --- sys/dev/isp/isp_freebsd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sys/dev/isp') diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index f422659..6c4fd06 100644 --- a/sys/dev/isp/isp_freebsd.c +++ b/sys/dev/isp/isp_freebsd.c @@ -137,7 +137,7 @@ isp_attach(ispsoftc_t *isp) */ ISPLOCK_2_CAMLOCK(isp); sim = cam_sim_alloc(isp_action, isp_poll, "isp", isp, - device_get_unit(isp->isp_dev), 1, isp->isp_maxcmds, devq); + device_get_unit(isp->isp_dev), &Giant, 1, isp->isp_maxcmds, devq); if (sim == NULL) { cam_simq_free(devq); CAMLOCK_2_ISPLOCK(isp); @@ -224,7 +224,8 @@ isp_attach(ispsoftc_t *isp) if (IS_DUALBUS(isp)) { ISPLOCK_2_CAMLOCK(isp); sim = cam_sim_alloc(isp_action, isp_poll, "isp", isp, - device_get_unit(isp->isp_dev), 1, isp->isp_maxcmds, devq); + device_get_unit(isp->isp_dev), &Giant, 1, + isp->isp_maxcmds, devq); if (sim == NULL) { xpt_bus_deregister(cam_sim_path(isp->isp_sim)); xpt_free_path(isp->isp_path); @@ -2147,7 +2148,7 @@ isp_make_here(ispsoftc_t *isp, int tgt) * Allocate a CCB, create a wildcard path for this bus, * and schedule a rescan. */ - ccb = xpt_alloc_ccb_nowait(); + ccb = xpt_alloc_ccb_nowait(isp->isp_osinfo.sim); if (ccb == NULL) { isp_prt(isp, ISP_LOGWARN, "unable to alloc CCB for rescan"); CAMLOCK_2_ISPLOCK(mpt); -- cgit v1.1