From owner-freebsd-usb@FreeBSD.ORG Mon Feb 2 04:24:55 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 321451065674 for ; Mon, 2 Feb 2009 04:24:55 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id E94CD8FC23 for ; Mon, 2 Feb 2009 04:24:54 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 49529FF42; Mon, 2 Feb 2009 17:24:54 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8aJlB3BFLjPq; Mon, 2 Feb 2009 17:24:50 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Mon, 2 Feb 2009 17:24:50 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 47D4411428; Mon, 2 Feb 2009 17:24:50 +1300 (NZDT) Date: Sun, 1 Feb 2009 20:24:50 -0800 From: Andrew Thompson To: Hans Petter Selasky Message-ID: <20090202042450.GA45701@citylink.fud.org.nz> References: <200902011220.18745.hselasky@c2i.net> <200902011922.16810.hselasky@c2i.net> <20090201.112756.1320088159.imp@bsdimp.com> <200902011938.48670.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902011938.48670.hselasky@c2i.net> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2009 04:24:55 -0000 On Sun, Feb 01, 2009 at 07:38:47PM +0100, Hans Petter Selasky wrote: > On Sunday 01 February 2009, M. Warner Losh wrote: > > In message: <200902011922.16810.hselasky@c2i.net> > > > > Hans Petter Selasky writes: > > : In your patch you remove all error checking! If the taskqueue system does > > : not have an API function that can tell if the taskqueue is being drained > > : from inside the taskqueue callback, the taskqueue system has to be > > : modified! It cannot replace the existing system like it is now! > > > > Why does the taskqueue system need to provide that? Why can't the > > driver set a dying flag in the softc to communicate this fact to the > > taskqueue tasks? > > That's also possible. Thomas already made a "struct usb2_task" I think, where > this flag could be added. I have been thinking about this more. The main issue is usb requests timing out when the device is yanked, the udev structure should keep state on this and set it as detached before calling the device detach routine. This will allow usb requests that may be running in the taskqueue to abort gracefully and taskqueue should drain quite easily. If the device hasnt been yanked then it will have no issues draining as the queued tasks will happily run to completion. Andrew