From owner-cvs-src@FreeBSD.ORG Sun Apr 15 17:28:29 2007 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BF4AD16A40E for ; Sun, 15 Apr 2007 17:28:29 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id A1C9B13C4BD for ; Sun, 15 Apr 2007 17:28:29 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 86860 invoked from network); 15 Apr 2007 17:28:29 -0000 Received: from ppp-71-139-34-102.dsl.snfc21.pacbell.net (HELO ?10.0.0.235?) (nate-mail@71.139.34.102) by root.org with ESMTPA; 15 Apr 2007 17:28:29 -0000 Message-ID: <462260B7.8090602@root.org> Date: Sun, 15 Apr 2007 10:28:23 -0700 From: Nate Lawson User-Agent: Thunderbird 1.5.0.7 (X11/20061027) MIME-Version: 1.0 To: Scott Long References: <20070415084926.C77C816A521@hub.freebsd.org> In-Reply-To: <20070415084926.C77C816A521@hub.freebsd.org> X-Enigmail-Version: 0.94.1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/cam cam_ccb.h cam_periph.c cam_periph.h cam_sim.c cam_sim.h cam_xpt.c cam_xpt.h cam_xpt_periph.h src/sys/cam/scsi scsi_cd.c scsi_ch.c scsi_da.c scsi_low.c scsi_pass.c scsi_pt.c scsi_sa.c scsi_ses.c scsi_sg.c ... X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Apr 2007 17:28:29 -0000 Scott Long wrote: > scottl 2007-04-15 08:49:19 UTC > > FreeBSD src repository > > Modified files: > sys/cam cam_ccb.h cam_periph.c cam_periph.h > cam_sim.c cam_sim.h cam_xpt.c cam_xpt.h > cam_xpt_periph.h > sys/cam/scsi scsi_cd.c scsi_ch.c scsi_da.c scsi_low.c > scsi_pass.c scsi_pt.c scsi_sa.c > scsi_ses.c scsi_sg.c scsi_targ_bh.c > scsi_target.c > sys/dev/aac aac_cam.c > sys/dev/advansys advansys.c adwcam.c > sys/dev/aha aha.c > sys/dev/ahb ahb.c > sys/dev/aic aic.c > sys/dev/aic7xxx aic79xx_osm.c aic7xxx_osm.c > sys/dev/amd amd.c > sys/dev/amr amr_cam.c > sys/dev/arcmsr arcmsr.c > sys/dev/asr asr.c > sys/dev/ata atapi-cam.c > sys/dev/buslogic bt.c > sys/dev/ciss ciss.c > sys/dev/dpt dpt_scsi.c > sys/dev/esp ncr53c9x.c > sys/dev/firewire sbp.c sbp_targ.c > sys/dev/hptmv entry.c > sys/dev/iir iir.c > sys/dev/isp isp_freebsd.c > sys/dev/mly mly.c > sys/dev/mpt mpt_cam.c > sys/dev/ppbus vpo.c > sys/dev/rr232x osm_bsd.c > sys/dev/sym sym_hipd.c > sys/dev/trm trm.c > sys/dev/twa tw_osl_cam.c > sys/dev/usb umass.c > sys/dev/wds wd7000.c > sys/pci ncr.c > Log: > 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. > > Revision Changes Path > 1.35 +6 -3 src/sys/cam/cam_ccb.h > 1.65 +86 -45 src/sys/cam/cam_periph.c > 1.17 +5 -1 src/sys/cam/cam_periph.h > 1.10 +32 -27 src/sys/cam/cam_sim.c > 1.7 +19 -2 src/sys/cam/cam_sim.h > 1.176 +447 -319 src/sys/cam/cam_xpt.c > 1.8 +6 -0 src/sys/cam/cam_xpt.h > 1.6 +2 -2 src/sys/cam/cam_xpt_periph.h > 1.98 +244 -194 src/sys/cam/scsi/scsi_cd.c > 1.44 +38 -31 src/sys/cam/scsi/scsi_ch.c > 1.204 +85 -98 src/sys/cam/scsi/scsi_da.c > 1.27 +2 -2 src/sys/cam/scsi/scsi_low.c > 1.46 +32 -26 src/sys/cam/scsi/scsi_pass.c > 1.45 +19 -76 src/sys/cam/scsi/scsi_pt.c > 1.108 +47 -71 src/sys/cam/scsi/scsi_sa.c > 1.34 +36 -17 src/sys/cam/scsi/scsi_ses.c > 1.5 +38 -19 src/sys/cam/scsi/scsi_sg.c > 1.24 +2 -8 src/sys/cam/scsi/scsi_targ_bh.c > 1.73 +64 -16 src/sys/cam/scsi/scsi_target.c > 1.27 +1 -1 src/sys/dev/aac/aac_cam.c > 1.34 +1 -1 src/sys/dev/advansys/advansys.c > 1.27 +1 -1 src/sys/dev/advansys/adwcam.c > 1.63 +2 -2 src/sys/dev/aha/aha.c > 1.41 +1 -1 src/sys/dev/ahb/ahb.c > 1.26 +4 -1 src/sys/dev/aic/aic.c > 1.27 +1 -1 src/sys/dev/aic7xxx/aic79xx_osm.c > 1.48 +3 -2 src/sys/dev/aic7xxx/aic7xxx_osm.c > 1.35 +3 -2 src/sys/dev/amd/amd.c > 1.21 +1 -0 src/sys/dev/amr/amr_cam.c > 1.22 +3 -2 src/sys/dev/arcmsr/arcmsr.c > 1.84 +2 -1 src/sys/dev/asr/asr.c > 1.51 +1 -1 src/sys/dev/ata/atapi-cam.c > 1.49 +1 -1 src/sys/dev/buslogic/bt.c > 1.76 +2 -2 src/sys/dev/ciss/ciss.c > 1.56 +2 -1 src/sys/dev/dpt/dpt_scsi.c > 1.16 +1 -1 src/sys/dev/esp/ncr53c9x.c > 1.90 +1 -0 src/sys/dev/firewire/sbp.c > 1.11 +1 -1 src/sys/dev/firewire/sbp_targ.c > 1.16 +2 -1 src/sys/dev/hptmv/entry.c > 1.18 +2 -1 src/sys/dev/iir/iir.c > 1.138 +4 -3 src/sys/dev/isp/isp_freebsd.c > 1.44 +2 -0 src/sys/dev/mly/mly.c > 1.54 +7 -5 src/sys/dev/mpt/mpt_cam.c > 1.35 +3 -1 src/sys/dev/ppbus/vpo.c > 1.5 +2 -1 src/sys/dev/rr232x/osm_bsd.c > 1.64 +1 -1 src/sys/dev/sym/sym_hipd.c > 1.32 +1 -0 src/sys/dev/trm/trm.c > 1.9 +1 -1 src/sys/dev/twa/tw_osl_cam.c > 1.143 +3 -0 src/sys/dev/usb/umass.c > 1.13 +2 -1 src/sys/dev/wds/wd7000.c > 1.194 +3 -1 src/sys/pci/ncr.c > Amazing work, I owe you a beer for following through where none of us did. I see you went with the SIM lock approach, which seems reasonable. On the targ diff: @@ -229,44 +252,56 @@ { struct ioc_enable_lun *new_lun; struct cam_path *path; + struct cam_sim *sim; new_lun = (struct ioc_enable_lun *)addr; - status = xpt_create_path(&path, /*periph*/NULL, - new_lun->path_id, - new_lun->target_id, - new_lun->lun_id); + status = xpt_create_path_unlocked(&path, /*periph*/NULL, + new_lun->path_id, + new_lun->target_id, + new_lun->lun_id); if (status != CAM_REQ_CMP) { printf("Couldn't create path, status %#x\n", status); break; } + sim = xpt_path_sim(path); + mtx_lock(sim->mtx); status = targenable(softc, path, new_lun->grp6_len, new_lun->grp7_len); xpt_free_path(path); + mtx_unlock(sim->mtx); ^^^^^^^^^^^^^^^^^^^^^ break; } I think the unlock can come before freeing the path, can't it? -- Nate