From owner-freebsd-current@FreeBSD.ORG Wed Apr 4 08:12:03 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AA10916A401; Wed, 4 Apr 2007 08:12:03 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from cs1.cs.huji.ac.il (cs1.cs.huji.ac.il [132.65.16.10]) by mx1.freebsd.org (Postfix) with ESMTP id 6466813C465; Wed, 4 Apr 2007 08:12:03 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from pampa.cs.huji.ac.il ([132.65.80.32]) by cs1.cs.huji.ac.il with esmtp id 1HZ0b2-000C6b-Uq; Wed, 04 Apr 2007 11:12:00 +0300 X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.2 To: Scott Long In-reply-to: Your message of Tue, 03 Apr 2007 16:26:36 -0600 . Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 04 Apr 2007 11:12:00 +0300 From: Danny Braniss Message-ID: Cc: freebsd-scsi@freebsd.org, freebsd-current@freebsd.org Subject: Re: targclose doesn't return X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Apr 2007 08:12:03 -0000 I stumbled on the same problem when porting iSCSI to current, calling dev_destroy() hangs because si_threadcount is not zero, Tai-hwa Liang came up with a patch, which fixes the close(), but causes panics when rebooting. danny > Actually, I think it's a wildly incorrect use of the clone API. I'll > take a look at in the in next few days and try to commit something that > works. > > Scott > > > Scott Long wrote: > > My guess is that the kninit() in targopen isn't being cleaned up from in > > targclose. I'm not terribly familiar in how the knote API works, > > though. > > > > Scott > > > > > > Matthew Jacob wrote: > >> Yeah- I've seen this too. > >> > >> On 4/3/07, Alex Dupre wrote: > >>> Scott Long wrote: > >>> > Are there any other console messages from the targ driver? Can you > >>> > turn on CAMDEBUG and send us the trace of what is going on? > >>> > >>> CAMDEBUG is already on, but simply opening/closing the targ device, > >>> without sending any ioctl to enable it, shouldn't produce any CAM > >>> message. I traced the kernel thread and I found that it doesn't return > >>> from the destroy_devl() function: csw->d_purge is NULL and > >>> dev->si_threadcount is '1'. The thread enters the following block > >>> (kern_conf.c, row 690) and never exits. > >>> > >>> > >>> while (dev->si_threadcount != 0) { > >>> /* Use unique dummy wait ident */ > >>> msleep(&csw, &devmtx, PRIBIO, "devdrn", hz / 10); > >>> } > >>> > >>> > >>> -- > >>> Alex Dupre > >>> _______________________________________________ > >>> freebsd-scsi@freebsd.org mailing list > >>> http://lists.freebsd.org/mailman/listinfo/freebsd-scsi > >>> To unsubscribe, send any mail to "freebsd-scsi-unsubscribe@freebsd.org" > >>> > > > > _______________________________________________ > > freebsd-scsi@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-scsi > > To unsubscribe, send any mail to "freebsd-scsi-unsubscribe@freebsd.org" > > _______________________________________________ > freebsd-scsi@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-scsi > To unsubscribe, send any mail to "freebsd-scsi-unsubscribe@freebsd.org" >