From owner-freebsd-scsi@FreeBSD.ORG Fri Jun 1 03:10:52 2007 Return-Path: X-Original-To: freebsd-scsi@freebsd.org Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EEA5216A400 for ; Fri, 1 Jun 2007 03:10:52 +0000 (UTC) (envelope-from simokawa@freebsd.org) Received: from mail3.ecc.u-tokyo.ac.jp (mail3.ecc.u-tokyo.ac.jp [133.11.205.99]) by mx1.freebsd.org (Postfix) with ESMTP id B501B13C458 for ; Fri, 1 Jun 2007 03:10:52 +0000 (UTC) (envelope-from simokawa@freebsd.org) Received: from mail1.ecc.u-tokyo.ac.jp (mail1.ecc.u-tokyo.ac.jp [133.11.50.203]) by mail3.ecc.u-tokyo.ac.jp (Postfix) with ESMTP id A18B72C669 for ; Fri, 1 Jun 2007 11:47:45 +0900 (JST) Received: from spam004.ecc.u-tokyo.ac.jp (spam004.ecc.u-tokyo.ac.jp [133.11.50.197]) by mail1.ecc.u-tokyo.ac.jp (Postfix) with ESMTP id AEEC71006F for ; Fri, 1 Jun 2007 11:47:44 +0900 (JST) Received: from maru5.nunu.org (157.82.169.72 [157.82.169.72]) by spam004.ecc.u-tokyo.ac.jp (SpamBlock.pst 3.4.97) with ESMTP id <86wsyopf0t.wl%simokawa@FreeBSD.ORG> for ; Fri, 1 Jun 2007 11:47:15 +0900 Date: Fri, 01 Jun 2007 11:47:14 +0900 Message-ID: <86wsyopf0t.wl%simokawa@FreeBSD.ORG> From: Hidetoshi Shimokawa To: scottl@samsco.org User-Agent: Wanderlust/2.15.2 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.0.50 (i386-unknown-freebsd5.4) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-IP: 157.82.169.72 X-FROM-DOMAIN: freebsd.org X-FROM-EMAIL: simokawa@freebsd.org Cc: freebsd-scsi@freebsd.org Subject: CAM locking X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2007 03:10:53 -0000 Hi Scott, Thank you for your work on CAM. I have some questions about lock assertion. 1. Now, xpt_done() should be called with a sim lock for QUEUED ccbs. Why don't you add an assertion in xpt_done()? 2. CAMDEBUG seems useless with WITNESS because xpt_path_path_id() requires a sim lock. Can we safely drop the assertion? I have some problem with scsi_target and I'll describe it in another mail. Regards, ============================================= (cd /usr/src && patch -p6) < diff_to_current ============================================= --- //depot/vendor/freebsd/src/sys/cam/cam_xpt.c 2007/05/16 17:02:05 +++ //depot/user/simokawa/firewire_lock/sys/cam/cam_xpt.c 2007/05/23 08:44:59 @@ -4222,7 +4222,9 @@ path_id_t xpt_path_path_id(struct cam_path *path) { +#if 0 mtx_assert(path->bus->sim->mtx, MA_OWNED); +#endif return(path->bus->path_id); } @@ -4840,6 +4842,7 @@ sim = done_ccb->ccb_h.path->bus->sim; switch (done_ccb->ccb_h.path->periph->type) { case CAM_PERIPH_BIO: + mtx_assert(sim->mtx, MA_OWNED); TAILQ_INSERT_TAIL(&sim->sim_doneq, &done_ccb->ccb_h, sim_links.tqe); done_ccb->ccb_h.pinfo.index = CAM_DONEQ_INDEX; /\ Hidetoshi Shimokawa \/ simokawa@FreeBSD.ORG