From owner-freebsd-usb@FreeBSD.ORG Sun Feb 1 20:03:16 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 0C9E5106566C; Sun, 1 Feb 2009 20:03:16 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id BF7BF8FC1B; Sun, 1 Feb 2009 20:03:15 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n11K0MMh094357; Sun, 1 Feb 2009 13:00:22 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 01 Feb 2009 13:00:51 -0700 (MST) Message-Id: <20090201.130051.-2130550806.imp@bsdimp.com> To: hselasky@c2i.net From: "M. Warner Losh" In-Reply-To: <200902012031.56899.hselasky@c2i.net> References: <200902012001.06914.hselasky@c2i.net> <20090201191432.GD32503@citylink.fud.org.nz> <200902012031.56899.hselasky@c2i.net> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org, thompsa@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: Sun, 01 Feb 2009 20:03:16 -0000 In message: <200902012031.56899.hselasky@c2i.net> Hans Petter Selasky writes: : On Sunday 01 February 2009, Andrew Thompson wrote: : > On Sun, Feb 01, 2009 at 08:01:05PM +0100, Hans Petter Selasky wrote: : > > Hi Andrew, : > > : > > Regarding using taskqueues. : > > : > > Yes - USB2 can use taskqueues, but I would very much like to have the : > > original queueing mechanism intact. : > : > Can you explain this further? What is t0 vs t1? : > : > A taskqueue will execute tasks sequentially, : : Hi Andrew, : : I've looked in the taskqueue code: : : if (task->ta_pending) { : task->ta_pending++; : TQ_UNLOCK(queue); : return 0; : } : : Take the following for example. Now you changed it a little bit, but I see : similar issues where other commands are involved: : : 1) queue DTR on cmd : 2) queue DTR off cmd : 3) queue DTR on cmd This is a bad example. In this case, clearly you'd want to turn it on, wait for it to go on, wait a while, turn it off, wait for it to go off, wait a while, then repeat the on part. If you are trying to get a notch signal in DTR, you have to cope this way. If you are implementing an ioctl from userland to do this (as exposed by the tty system), then you'd need to wait for the DTR command to finish anyway before returning to userland, no? There's likely other reasons for wanting to do this, but DTR changes should be synchronous to the caller. Warner