From owner-freebsd-scsi@FreeBSD.ORG Tue Feb 27 00:26:38 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 80E7916A409 for ; Tue, 27 Feb 2007 00:26:38 +0000 (UTC) (envelope-from thomas@melamine.cuivre.fr.eu.org) Received: from melamine.cuivre.fr.eu.org (melusine.cuivre.fr.eu.org [82.225.155.84]) by mx1.freebsd.org (Postfix) with ESMTP id 464DC13C4A7 for ; Tue, 27 Feb 2007 00:26:34 +0000 (UTC) (envelope-from thomas@melamine.cuivre.fr.eu.org) Received: by melamine.cuivre.fr.eu.org (Postfix, from userid 1000) id 7C66E5C1A1; Tue, 27 Feb 2007 00:55:28 +0100 (CET) Resent-From: thomas@melamine.cuivre.fr.eu.org Resent-Date: Tue, 27 Feb 2007 00:55:28 +0100 Resent-Message-ID: <20070226235528.GA71839@melamine.cuivre.fr.eu.org> Resent-To: freebsd-scsi@freebsd.org Date: Sun, 25 Feb 2007 20:38:02 +0100 From: Thomas Quinot To: freebsd-scsi@freebsd.org Message-ID: <20070225193802.GA32605@melamine.cuivre.fr.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-message-flag: WARNING! Using Outlook can damage your computer. User-Agent: Mutt/1.5.11 Subject: xpt_done() and Giant? 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: Tue, 27 Feb 2007 00:26:38 -0000 I'm currently trying to debug ATAPI/CAM issues with a particular ATA controller (kern/103602). Over the course of investigating this PR, the user reported the following crash when enabling CAMDEBUG: Tracing pid 16 tid 100014 td 0xc5106bd0 kdb_enter(c0a48ff7,0,c0a482f1,e3cbaba8,c5106bd0,...) at kdb_enter+0x30 panic(c0a482f1,c0a60666,c0a004cc,1033,c560c430,...) at panic+0x13b _mtx_assert(c0b4caa8,1,c0a004cc,1033,c5610000,...) at _mtx_assert+0x86 xpt_path_comp(c5410660,c560c430,c5462c40,c55e3e60,c5610000,...) at xpt_path_comp+0x32 xpt_done(c5610000,c546ae3c,c55e2b64,e3cbac3c,c55e2398,...) at xpt_done+0x30 free_hcb_and_ccb_done(c546ae3c,0,c55e2b64,2d2,1,...) at free_hcb_and_ccb_done+0x3c atapi_cb(c5486480,52,c0a4cb11,e3cbac74,c0748b94,...) at atapi_cb+0x78 ata_completed(c5486480,1,c0a4cb11,52,c5173b1c,...) at ata_completed+0x5c2 It looks to me like we're calling xpt_done() without holding Giant, which should work AFAICT, except that when enabling CAMDEBUG, xpt_done calls xpt_path_comp, which still has a GIANT_REQUIRED assertion, hence the failure above. So, should we maybe grab Giant in CAM_DEBUG? Thomas.